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: "implementing FormatEvent" docs #1727

Merged
merged 5 commits into from Nov 19, 2021
Merged

subscriber: "implementing FormatEvent" docs #1727

merged 5 commits into from Nov 19, 2021

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Nov 19, 2021

This branch adds some documentation to the FormatEvent trait in
tracing_subscriber::fmt on how to write user-provided FormatEvent
implementations. There's probably room for additional improvement here,
but I just wanted to get something written down for now.

I also fixed a broken link I noticed while I was here.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw requested review from davidbarsky and a team as code owners November 19, 2021 19:39
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
tracing-subscriber/src/fmt/format/mod.rs Outdated Show resolved Hide resolved
/// does not support ANSI escape codes (such as a log file), and they should
/// not be emitted.
///
/// Crates like [`ansi_term`] and [`owo-colors`] can be used to add ANSI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, that's a good name

Comment on lines +232 to +233
//! The [`FormatFields`] trait determines how fields &mdash; both the event's
//! fields and fields on spans &mdash; are formatted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the use of &mdash; instead of intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't remember the hotkey for typing a literal em dash on my keyboard...

Co-authored-by: David Barsky <me@davidbarsky.com>
@hawkw hawkw merged commit 772290d into master Nov 19, 2021
@hawkw hawkw deleted the eliza/ansi-dox branch November 19, 2021 22:34
hawkw added a commit that referenced this pull request Nov 20, 2021
This branch adds some documentation to the `FormatEvent` trait in
`tracing_subscriber::fmt` on how to write user-provided `FormatEvent`
implementations. There's probably room for additional improvement here,
but I just wanted to get something written down for now.

I also fixed a broken link I noticed while I was here.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Co-authored-by: David Barsky <me@davidbarsky.com>
hawkw added a commit that referenced this pull request Nov 20, 2021
This branch adds some documentation to the `FormatEvent` trait in
`tracing_subscriber::fmt` on how to write user-provided `FormatEvent`
implementations. There's probably room for additional improvement here,
but I just wanted to get something written down for now.

I also fixed a broken link I noticed while I was here.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Co-authored-by: David Barsky <me@davidbarsky.com>
hawkw added a commit that referenced this pull request Nov 20, 2021
This branch adds some documentation to the `FormatEvent` trait in
`tracing_subscriber::fmt` on how to write user-provided `FormatEvent`
implementations. There's probably room for additional improvement here,
but I just wanted to get something written down for now.

I also fixed a broken link I noticed while I was here.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Co-authored-by: David Barsky <me@davidbarsky.com>
hawkw added a commit that referenced this pull request Nov 20, 2021
This branch adds some documentation to the `FormatEvent` trait in
`tracing_subscriber::fmt` on how to write user-provided `FormatEvent`
implementations. There's probably room for additional improvement here,
but I just wanted to get something written down for now.

I also fixed a broken link I noticed while I was here.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Co-authored-by: David Barsky <me@davidbarsky.com>
hawkw added a commit that referenced this pull request Nov 20, 2021
# 0.3.2 (Nov 19, 2021)

### Fixed

- **fmt**: Fixed `MakeWriter` filtering not working with `BoxMakeWriter`
  ([#1694])

### Added

- **fmt**: `Writer::has_ansi_escapes` method to check if an output
  supports ANSI terminal formatting escape codes ([#1696])
- **fmt**: Added additional ANSI terminal formatting to field formatters
  when supported ([#1702])
- **fmt**: Added `FmtContext::span_scope`, `FmtContext::event_scope`,
  and `FmtContext::parent_span` methods for accessing the current span
  and its scope when formatting an event ([#1728])
- **fmt**: Improved documentation on implementing event formatters
  ([#1727])

[#1694]: #1694
[#1696]: #1696
[#1702]: #1702
[#1728]: #1728
[#1727]: #1727
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.

None yet

2 participants