fix(logging): applied env filter to global logging and applied timestamp saving. The readme was updated aswell

This commit is contained in:
objz committed 2026-04-23 20:13:08 +02:00
1 parent a660f4a31b
commit e2caf66c19
3 files changed
+23 -10

No files matched your search

Generated
+1 -1
View File
@@ -1830,7 +1830,7 @@ dependencies = [
[[package]]
name = "mcl-launcher"
version = "0.1.0"
version = "0.2.0"
dependencies = [
"async-trait",
"chrono",
+18 -7
View File
@@ -85,16 +85,27 @@ mcl can be compiled for Linux, macOS, and Windows. right now it's only packaged
## where things live
| path | what |
|---|---|
| `~/.config/mcl/config.toml` | general config (paths, memory defaults, UI settings) |
| `~/.config/mcl/theme.toml` | theme, border style, color overrides |
| `~/.config/mcl/accounts.json` | accounts |
| `~/.local/share/mcl/instances/` | instances, each in its own directory |
| `~/.local/share/mcl/meta/` | cached game metadata, libraries, assets, loader profiles |
### config & data
settings, accounts, instances, and cached game metadata.
| what | Linux | macOS | Windows |
|---|---|---|---|
| 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.
### 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
+4 -2
View File
@@ -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 env_filter = EnvFilter::builder()
.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 tui_level = if rust_log.contains("debug") || rust_log.contains("trace") {