Uh oh!
There was an error while loading. Please reload this page.
refactor!: remove logforth core global logger - #226
Conversation
Signed-off-by: tison <wander4096@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the logforth_core “default/global logger” concept and shifts global log crate integration to explicit logforth-bridge-log adapter types (and logforth’s starter-log feature), updating examples, features, and docs accordingly.
Changes:
- Removed core-level global logger APIs (
default_logger,set_default_logger,LoggerBuilder::{apply, try_apply}) soLoggerBuilderonly constructsLoggerinstances. - Refactored the
logbridge to exposeLogAdapter/OwnedLogAdapter/SharedLogAdapterand removed the previous globalsetup/try_setuphelpers. - Updated
starter_logto register thelogcrate’s global logger directly usingOwnedLogAdapter, and adjusted examples/docs/features to match the new model.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
logforth/src/starter_log.rs | Switches starter to install the log global logger via OwnedLogAdapter instead of relying on a core default logger. |
logforth/src/lib.rs | Removes re-exports of core global logger APIs and gates starter_log behind starter-log. |
logforth/Cargo.toml | Updates starter-log feature to include an optional log dependency. |
examples/src/log_with_logger.rs | Renames example usage from OwnedLogProxy to OwnedLogAdapter. |
examples/src/asynchronous.rs | Demonstrates keeping a logger handle (SharedLogAdapter) and registering it with log::set_boxed_logger. |
examples/Cargo.toml | Aligns example feature wiring with logforth/starter-log and updates required features for examples. |
core/src/logger/mod.rs | Drops re-exports of the removed global logger APIs. |
core/src/logger/log_impl.rs | Removes the OnceLock-backed default logger implementation. |
core/src/logger/builder.rs | Removes global-logger setup methods and updates doctests to use build(). |
CHANGELOG.md | Updates breaking-change guidance to reflect “keep a logger handle” instead of using default_logger().flush(). |
bridges/log/src/lib.rs | Replaces global setup with explicit adapter types (borrowed/owned/shared) and removes setup/try_setup. |
appenders/syslog/src/lib.rs | Updates docs to build a logger without relying on removed global logger APIs. |
appenders/syslog/Cargo.toml | Removes log dev-dependency (previously used by the docs/example path). |
appenders/file/src/rolling.rs | Updates rand trait import in tests (RngExt). |
appenders/file/src/lib.rs | Updates docs to build a logger without relying on removed global logger APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0dede20 to
379428fCompare379428f to
3c60104CompareSigned-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This closes#214