-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: tison <[email protected]>
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# CHANGELOG | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
## [0.14.0] 2024-10-28 | ||
|
||
Breaking changes: | ||
|
||
1. refactor: layouts and encoders should be nested to appenders ([#64](https://github.com/fast/logforth/pull/64)) | ||
|
||
Previous code: | ||
|
||
```rust | ||
fn main() { | ||
Logger::new() | ||
.dispatch( | ||
Dispatch::new() | ||
.filter(LevelFilter::Trace) | ||
.layout(JsonLayout::default()) | ||
.append(append::Stdout), | ||
) | ||
.apply() | ||
.unwrap(); | ||
|
||
log::error!("Hello error!"); | ||
log::warn!("Hello warn!"); | ||
log::info!("Hello info!"); | ||
log::debug!("Hello debug!"); | ||
log::trace!("Hello trace!"); | ||
} | ||
``` | ||
|
||
New code: | ||
|
||
```rust | ||
fn main() { | ||
Logger::new() | ||
.dispatch( | ||
Dispatch::new() | ||
.filter(LevelFilter::Trace) | ||
.append(append::Stdout::default().with_layout(JsonLayout::default())), | ||
) | ||
.apply() | ||
.unwrap(); | ||
|
||
log::error!("Hello error!"); | ||
log::warn!("Hello warn!"); | ||
log::info!("Hello info!"); | ||
log::debug!("Hello debug!"); | ||
log::trace!("Hello trace!"); | ||
} | ||
``` | ||
|
||
2. refactor: unify level/target filter to directive filter ([#65](https://github.com/fast/logforth/pull/65)) | ||
|
||
Most `From` conversions are kept so that typically you won't notice the change. But if you directly use `LevelFilter` and `TargetFilter`, they are now removed. The functionalities can be covered by `EnvFilter`. | ||
|
||
Also, the feature flag `env-filter` is removed. The `EnvFilter` is always available now. |