fix(logging): applied env filter to global logging and applied timestamp saving. The readme was updated aswell
This commit is contained in:
1 parent
a660f4a31b
commit
e2caf66c19
3 files changed
+23
-10
No files matched your search
Generated
+1
-1
@@ -1830,7 +1830,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mcl-launcher"
|
name = "mcl-launcher"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|||||||
@@ -85,16 +85,27 @@ mcl can be compiled for Linux, macOS, and Windows. right now it's only packaged
|
|||||||
|
|
||||||
## where things live
|
## where things live
|
||||||
|
|
||||||
| path | what |
|
### config & data
|
||||||
|---|---|
|
|
||||||
| `~/.config/mcl/config.toml` | general config (paths, memory defaults, UI settings) |
|
settings, accounts, instances, and cached game metadata.
|
||||||
| `~/.config/mcl/theme.toml` | theme, border style, color overrides |
|
|
||||||
| `~/.config/mcl/accounts.json` | accounts |
|
| what | Linux | macOS | Windows |
|
||||||
| `~/.local/share/mcl/instances/` | instances, each in its own directory |
|
|---|---|---|---|
|
||||||
| `~/.local/share/mcl/meta/` | cached game metadata, libraries, assets, loader profiles |
|
| config (`config.toml`, `theme.toml`, `accounts.json`) | `~/.config/mcl/` | `~/Library/Application Support/mcl/` | `%APPDATA%\mcl\` |
|
||||||
|
| instances | `~/.local/share/mcl/instances/` | `~/Library/Application Support/mcl/instances/` | `%LOCALAPPDATA%\mcl\instances\` |
|
||||||
|
| metadata (versions, libraries, assets, loader profiles) | `~/.local/share/mcl/meta/` | `~/Library/Application Support/mcl/meta/` | `%LOCALAPPDATA%\mcl\meta\` |
|
||||||
|
|
||||||
each instance has an `instance.json` for its config and a `.minecraft/` directory with the actual game files. standard layout, nothing weird.
|
each instance has an `instance.json` for its config and a `.minecraft/` directory with the actual game files. standard layout, nothing weird.
|
||||||
|
|
||||||
|
### logs
|
||||||
|
|
||||||
|
launcher logs are per-session and contain mcl's own output. instance launch logs capture game stdout/stderr per launch.
|
||||||
|
|
||||||
|
| what | Linux | macOS | Windows |
|
||||||
|
|---|---|---|---|
|
||||||
|
| launcher logs | `~/.cache/mcl/` | `~/Library/Caches/mcl/` | `%LOCALAPPDATA%\mcl\` |
|
||||||
|
| instance launch logs | `<instances>/<name>/.minecraft/logs/launches/` | same | same |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## configuration
|
## configuration
|
||||||
|
|||||||
+4
-2
@@ -54,12 +54,14 @@ pub fn init() -> WorkerGuard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let file_appender = tracing_appender::rolling::daily(&log_dir, "mcl.log");
|
let now = chrono::Local::now().format("%Y-%m-%d_%H-%M-%S");
|
||||||
|
let file_appender = tracing_appender::rolling::never(&log_dir, format!("mcl_{now}.log"));
|
||||||
let (non_blocking, guard) = tracing_appender::non_blocking(file_appender);
|
let (non_blocking, guard) = tracing_appender::non_blocking(file_appender);
|
||||||
|
|
||||||
let env_filter = EnvFilter::builder()
|
let env_filter = EnvFilter::builder()
|
||||||
.with_default_directive(Level::INFO.into())
|
.with_default_directive(Level::INFO.into())
|
||||||
.from_env_lossy();
|
.from_env_lossy()
|
||||||
|
.add_directive("mc_instance=off".parse().unwrap());
|
||||||
|
|
||||||
let rust_log = std::env::var("RUST_LOG").unwrap_or_default().to_lowercase();
|
let rust_log = std::env::var("RUST_LOG").unwrap_or_default().to_lowercase();
|
||||||
let tui_level = if rust_log.contains("debug") || rust_log.contains("trace") {
|
let tui_level = if rust_log.contains("debug") || rust_log.contains("trace") {
|
||||||
|
|||||||
Reference in new issue
Block a user