-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add a toggle to enable more precise timestamp #87
Comments
Thanks for the suggestion @cecton! I've kept the timestamp formatting in Being able to increase the precision of that format sounds like a good idea though. We could do something like: impl Builder {
// defaults to `false`, like our current format
fn default_format_timestamp_nanos(yes: bool);
}
impl Formatter {
fn precise_timestamp(&self) -> PreciseTimestamp;
}
impl Timestamp {
fn precise(&self) -> PreciseTimestamp {
PreciseTimestamp(self.0)
}
}
// Same as Timestamp, but uses a format like 2018-02-14T00:28:07.000000000Z
struct PreciseTimestamp(SystemTime); So that when you set |
I would gladly try to make a PR if I could but I'm not experienced enough in Rust at the moment to make something good. I will probably give it a try at some point if nobody does before. Btw, I just thought about something... what about a feature flag? I saw that in the earlier versions of env_logger the logs where more detailed, maybe implementing a feature flag is easier I don't know (I have no idea 😁 ) |
@cecton I'd be more than happy to help you through a PR if you'd like to give it a shot! I think managing this through our builders rather than feature flags makes the most sense for |
(I still plan to do it) |
@KodrAus @cecton, hi! I also agree that we need more precise timestamp. |
@ivan-ochc If I understand correctly you're asking if the RFC3339 format with nanos is the right one for us to use? I think it's the most appropriate format for our high-precision timestamp that means we can stick with |
This was released in |
In my application I really need to see the exact time it takes in milliseconds between each log. This will give me an idea if something is slow.
As suggested here, I'm asking if it would be possible to implement a toggle to have it more precise?
The text was updated successfully, but these errors were encountered: