-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update
Compact
formatter docs (#1926)
## Motivation Currently, the RustDoc for the `format::Compact` formatter in `tracing-subscriber` describes the output from the `master` (v0.2.x) version of the formatter, not the version on the v0.1.x branch. ## Solution This PR updates the documentation to describe the actual output format. Also, I added an example of the formatter in the `examples` directory. Closes #1909
- Loading branch information
Showing
3 changed files
with
45 additions
and
11 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
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,22 @@ | ||
#![deny(rust_2018_idioms)] | ||
#[path = "fmt/yak_shave.rs"] | ||
mod yak_shave; | ||
|
||
fn main() { | ||
tracing_subscriber::fmt() | ||
.compact() | ||
// enable everything | ||
.with_max_level(tracing::Level::TRACE) | ||
// sets this to be the default, global collector for this application. | ||
.init(); | ||
|
||
let number_of_yaks = 3; | ||
// this creates a new event, outside of any spans. | ||
tracing::info!(number_of_yaks, "preparing to shave yaks"); | ||
|
||
let number_shaved = yak_shave::shave_all(number_of_yaks); | ||
tracing::info!( | ||
all_yaks_shaved = number_shaved == number_of_yaks, | ||
"yak shaving completed" | ||
); | ||
} |
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