fix(logging): default to errors only in all build modes

Honor the request for quiet default logging by showing only errors in
both debug and release builds. Previously, development builds logged at
debug level and release builds at info level.

Set the default filter to error in the core logger, WebAssembly logger,
and GTK demo. Keep the existing RUST_LOG overrides in the native logger
and demo so users can enable more detail when troubleshooting. WebAssembly
continues to use a fixed filter without an environment override.

Update logger comments to describe the new default.

Test Plan:
- Passed: cargo test -p ghostty-core global::tests --lib (3 tests).
- Passed: git diff --check.
- Manual: launch without RUST_LOG and confirm only errors are logged;
  use RUST_LOG=debug to confirm native verbose logging remains available.
- WebAssembly and the GTK demo were not built or run.

Requested-by: User request for errors-only default logging
This commit is contained in:
ddidderr committed 2026-10-12 21:28:43 +02:00
1 parent 8b80ec0988
commit 9f203f375f
3 files changed
+6 -13

No files matched your search

+2 -8
View File
@@ -62,15 +62,9 @@ impl Log for Logger {
static LOGGER: Logger = Logger;
/// Installs the logger. Zig's level: debug in Debug, warn in ReleaseSmall,
/// info otherwise; here debug with `debug_assertions`, info otherwise.
/// Installs the logger with errors only in every build mode.
pub fn init() {
let level = if cfg!(debug_assertions) {
LevelFilter::Debug
} else {
LevelFilter::Info
};
if ::log::set_logger(&LOGGER).is_ok() {
::log::set_max_level(level);
::log::set_max_level(LevelFilter::Error);
}
}