Skip to content

fix(logging): restore RUST_LOG env var support in init_logging#78

Merged
missuo merged 1 commit into
missuo:mainfrom
thedavidweng:cursor/m3-logging-improvements-ab4a
Apr 13, 2026
Merged

fix(logging): restore RUST_LOG env var support in init_logging#78
missuo merged 1 commit into
missuo:mainfrom
thedavidweng:cursor/m3-logging-improvements-ab4a

Conversation

@thedavidweng

Copy link
Copy Markdown
Contributor

Summary

Restore RUST_LOG environment variable support in init_logging() by replacing hardcoded filter_level(Info) with Builder::from_env(). Default filter remains info when RUST_LOG is not set.

Motivation

The current implementation ignores RUST_LOG entirely, contradicting DESIGN.md §25.3:

Rust core uses env_logger which outputs to stderr. To view logs, run the app from terminal with RUST_LOG=info.

This makes it impossible to enable debug-level logging without modifying source code.

Changes

  • koe-core/src/telemetry.rs: init_logging() now uses env_logger::Builder::from_env(Env::default().default_filter_or("info")) instead of builder().filter_level(Info)

Behavior

Scenario Before After
No RUST_LOG set info level info level (unchanged)
RUST_LOG=debug info level (ignored) debug level ✅
RUST_LOG=koe_core=debug info level (ignored) debug for koe_core only ✅

Testing

  • cargo check --no-default-features -p koe-core — ✅
  • cargo clippy --no-default-features -p koe-core — ✅ (1 pre-existing warning, unrelated)
  • cargo test --no-default-features -p koe-core — ✅ 44 tests pass
  • cargo fmt --check — ✅

Replace hardcoded filter_level(Info) with Builder::from_env() so the
RUST_LOG environment variable can control log verbosity at runtime.
Default filter remains 'info' when RUST_LOG is not set.

Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
@missuo missuo merged commit 1c0f32b into missuo:main Apr 13, 2026
@thedavidweng thedavidweng deleted the cursor/m3-logging-improvements-ab4a branch April 13, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants