refactor: factor out env-filter as logforth-filter-rustlog#231
Merged
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses #230 by extracting the env_filter implementation out of logforth-core into a dedicated filter crate (logforth-filter-rustlog), updating Logforth’s public surface and examples to use the new filter crate and naming.
Changes:
- Introduces the new
logforth-filter-rustlogcrate and wires it into the workspace andlogforthfeature set (filter-rustlog). - Removes
env_filterfromlogforth-coreand updates starters/examples to useRustLogFilter/RustLogFilterBuilder. - Renames the
logbridge type fromLogAdaptertoLogBridgeand updates call sites.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
Cargo.toml |
Adds filters/* to workspace members and registers logforth-filter-rustlog as a workspace dependency. |
CHANGELOG.md |
Documents the env-filter extraction/rename under breaking changes. |
core/src/filter/mod.rs |
Removes env_filter module and EnvFilter re-export from logforth-core. |
core/Cargo.toml |
Removes now-unused dev dependency entries related to the moved filter tests. |
filters/rustlog/Cargo.toml |
Adds new crate manifest for logforth-filter-rustlog. |
filters/rustlog/README.md |
Updates crate README header for the extracted filter crate. |
filters/rustlog/src/lib.rs |
Implements/renames filter API to RustLogFilter + builder and switches to logforth-core types. |
filters/rustlog/src/tests.rs |
Updates tests to the extracted crate and renamed types. |
logforth/Cargo.toml |
Adds filter-rustlog feature and includes it in starter-log. |
logforth/src/lib.rs |
Re-exports the new filter crate behind the filter-rustlog feature. |
logforth/src/starter_log.rs |
Updates starter defaults to use RustLogFilterBuilder and renames LogAdapter usage to LogBridge. |
bridges/log/src/lib.rs |
Renames the public bridge type to LogBridge. |
examples/Cargo.toml |
Adds a passthrough feature for filter-rustlog. |
examples/src/asynchronous.rs |
Updates example to use LogBridge. |
examples/src/log_with_logger.rs |
Updates example to use LogBridge. |
examples/src/per_module_log_levels.rs |
Updates example to use RustLogFilterBuilder. |
examples/src/per_module_with_ctor.rs |
Updates example helper to build a RustLogFilter via RustLogFilterBuilder. |
Comments suppressed due to low confidence (3)
filters/rustlog/src/lib.rs:43
- Minor grammar in crate-level docs: "most common used" should be "most commonly used".
filters/rustlog/src/lib.rs:159 - Grammatically, this should be "a [
RustLogFilter]" (not "an").
filters/rustlog/src/lib.rs:318 - Grammatically, this should be "a [
RustLogFilter]" (not "an").
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 #230