Skip to content
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 2 commits into from
Nov 2, 2020
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Nov 2, 2020

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
!

Signed-off-by: Eliza Weisman eliza@buoyant.io

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 hawkw requested a review from a team as a code owner November 2, 2020 20:58
@hawkw hawkw changed the title subscriber: add Pretty formatter (#1067) subscriber: add Pretty formatter (backports #1067) Nov 2, 2020
@hawkw hawkw merged commit 8bdc6c3 into v0.1.x Nov 2, 2020
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant