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

Allow time formatting of events through time::formatting::Formattable #71

Open
ten3roberts opened this issue Oct 11, 2023 · 1 comment

Comments

@ten3roberts
Copy link
Contributor

The current implementation of event time formatting only allows for the default date time formatting 2023-10-11 13:57:26.676558 +02:00:00 which can be very verbose and creates long lines in the terminal output.

Proposal

Add an extra field to UtcDateTime and LocalDateTime that allows the user to specify their own time formatter using https://docs.rs/time/latest/time/formatting/trait.Formattable.html

This would allow timestamps such as 13:57:26 or other user preference

@davidbarsky
Copy link
Owner

Sorry for the delay. I agree that we should provide customization, but my preference is to expose this through tracing_subscriber::fmt::time::FormatTime interface, which will function as a superset of time::formatting::Formattable.

(We have unreleased changes to tracing-subscriber that re-introduces support for chrono and my personal preference for tracing-subscriber, going forward, would be to use chrono instead of time.)

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

No branches or pull requests

2 participants