Skip to content

Refactor logger with defensive improvements and reduced complexity - #43

Merged
z80020100 merged 7 commits into
mainfrom
refactor_logger
Mar 14, 2026
Merged

z80020100 merged 7 commits into
mainfrom
refactor_logger

Conversation

@z80020100

Copy link
Copy Markdown
Owner

Summary

  • Replace UtcOffset::current_local_offset().unwrap() with unwrap_or(UtcOffset::UTC) to prevent panic in multi-threaded environments
  • Replace deeply nested generic type aliases (FIXME: clippy::type_complexity) with Box<dyn LevelFilterReloader> trait object
  • Refactor reconfig() to parse-then-apply pattern with rollback on partial failure
  • Extract parse_level_filter() helper to reduce duplication
  • Lower default log levels to TRACE and adjust init/config log levels

Closes #36
Closes #38

Test plan

  • cargo build passes
  • cargo fmt --all -- --check passes
  • cargo clippy passes with no warnings
  • cargo test passes

@z80020100 z80020100 self-assigned this Mar 14, 2026
@z80020100
z80020100 merged commit dbc4269 into main Mar 14, 2026
3 checks passed
@z80020100
z80020100 deleted the refactor_logger branch March 14, 2026 06:08
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.

Logger: resolve type complexity and reduce reconfig() duplication UtcOffset::current_local_offset().unwrap() may panic in multi-threaded environments

1 participant