refactor!: remove logforth core global logger#226
Merged
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.
0dede20 to
379428f
Compare
379428f to
3c60104
Compare
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes #214