-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subscriber: add Pretty
formatter (backports #1067)
#1080
Merged
Merged
Conversation
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 backports PR #1067 to v0.1.x. Since this has already been approved on master, I'm just going to go ahead and merge it when CI passes. Motivation ---------- Currently, the `tracing_subscriber::fmt` module contains only single-line event formatters. Some users have requested a human-readable, pretty-printing event formatter optimized for aesthetics. Solution -------- This branch adds a new `Pretty` formatter which uses an _excessively_ pretty output format. It's neither compact, single-line oriented, nor easily machine-readable, but it looks _quite_ nice, in my opinion. This is well suited for local development or potentially for user-facing logs in a CLI application. Additionally, I tried to improve the docs for the different formatters currently provided, including example output. Check out [the Netlify preview][1]! [1]: https://deploy-preview-1067--tracing-rs.netlify.app/tracing_subscriber/fmt/index.html#formatters Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw
changed the title
subscriber: add
subscriber: add Nov 2, 2020
Pretty
formatter (#1067)Pretty
formatter (backports #1067)
hawkw
added a commit
that referenced
this pull request
Nov 2, 2020
Fixed - **fmt**: Fixed wrong lifetime parameters on `FormatFields` impl for `FmtContext` ([#1082]) Added - **fmt**: `format::Pretty`, an aesthetically pleasing, human-readable event formatter for local development and user-facing CLIs ([#1080]) - **fmt**: `FmtContext::field_format`, which returns the subscriber's field formatter ([#1082]) [#1082]: #1082 [#1080]: #1080
hawkw
added a commit
that referenced
this pull request
Nov 2, 2020
### Fixed - **fmt**: Fixed wrong lifetime parameters on `FormatFields` impl for `FmtContext` ([#1082]) ### Added - **fmt**: `format::Pretty`, an aesthetically pleasing, human-readable event formatter for local development and user-facing CLIs ([#1080]) - **fmt**: `FmtContext::field_format`, which returns the subscriber's field formatter ([#1082]) [#1082]: #1082 [#1080]: #1080
kaffarell
pushed a commit
to kaffarell/tracing
that referenced
this pull request
May 22, 2024
…s#1080) This backports PR tokio-rs#1067 to v0.1.x. Since this has already been approved on master, I'm just going to go ahead and merge it when CI passes. Currently, the `tracing_subscriber::fmt` module contains only single-line event formatters. Some users have requested a human-readable, pretty-printing event formatter optimized for aesthetics. This branch adds a new `Pretty` formatter which uses an _excessively_ pretty output format. It's neither compact, single-line oriented, nor easily machine-readable, but it looks _quite_ nice, in my opinion. This is well suited for local development or potentially for user-facing logs in a CLI application. Additionally, I tried to improve the docs for the different formatters currently provided, including example output. Check out [the Netlify preview][1]! [1]: https://deploy-preview-1067--tracing-rs.netlify.app/tracing_subscriber/fmt/index.html#formatters Signed-off-by: Eliza Weisman <eliza@buoyant.io>
kaffarell
pushed a commit
to kaffarell/tracing
that referenced
this pull request
May 22, 2024
### Fixed - **fmt**: Fixed wrong lifetime parameters on `FormatFields` impl for `FmtContext` ([tokio-rs#1082]) ### Added - **fmt**: `format::Pretty`, an aesthetically pleasing, human-readable event formatter for local development and user-facing CLIs ([tokio-rs#1080]) - **fmt**: `FmtContext::field_format`, which returns the subscriber's field formatter ([tokio-rs#1082]) [tokio-rs#1082]: tokio-rs#1082 [tokio-rs#1080]: tokio-rs#1080
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 backports PR #1067 to v0.1.x. Since this has already been approved
on master, I'm just going to go ahead and merge it when CI passes.
Motivation
Currently, the
tracing_subscriber::fmt
module contains onlysingle-line event formatters. Some users have requested a
human-readable, pretty-printing event formatter optimized for
aesthetics.
Solution
This branch adds a new
Pretty
formatter which uses an excessivelypretty output format. It's neither compact, single-line oriented, nor
easily machine-readable, but it looks quite nice, in my opinion. This
is well suited for local development or potentially for user-facing logs
in a CLI application.
Additionally, I tried to improve the docs for the different formatters
currently provided, including example output. Check out the Netlify
preview!
Signed-off-by: Eliza Weisman eliza@buoyant.io