-
Notifications
You must be signed in to change notification settings - Fork 874
fmt: add with_event_name configuration option #3358
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
base: main
Are you sure you want to change the base?
Conversation
Adds with_event_name() to control display of event names in formatted output. Filters out verbose default names like "event src/main.rs:123", showing only custom event names when enabled. Closes tokio-rs#2774
kaffarell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it a bit weird that enabling the option can still cause the name field to not be shown. Maybe as an alternative to this PR we could consider always showing the name field in the Full format when it is not the default value?
|
Hey, thank you for the feedback! :D Just to wanted to make sure I understand correctly - you're suggesting that in the Full formatter, we should automatically show custom event names (when they're different from the default), without requiring a configuration option? This would be only in the full formatter not the compact? So:
|
|
Yep, that's what I thought. But maybe someone else wants to chime in -- @davidbarsky what do you think? |
|
Hey, just wondering what am post to do now? |
|
@hawkw @davidbarsky Could you review this PR and take it forward? We are really looking forward to using this from OpenTelemetry and OpenTelemetry-Arrow projects! |
|
@hds Could you help review/merge? |
Fixes #2774
Motivation
Event names set with
event!(name: "...", ...)are currently not shown in the output. Users sometimes want to see custom event names, like how span names are displayed.Solution
Added
with_event_name()option to control display of event name:"event src/main.rs:123"Example: