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

Add a timestamps_utc configuration #45

Closed
wants to merge 1 commit into from

Conversation

uggla
Copy link

@uggla uggla commented Dec 13, 2021

Display timestamps in utc instead of local time.

This is a workaround of #44. As OffsetDateTime::now_utc() is safe, it can be used in non single-threaded program.

- Display timestamps in utc instead of local time.
@borntyping
Copy link
Owner

Closing this with my sincere apologies - I've implemented this myself in #46 as I don't want to have this configured by compile time feature flags when timestamps already exists, and there's been enough issues opened on this topic that I wanted to get a release out quickly.

@borntyping borntyping closed this Dec 14, 2021
@uggla
Copy link
Author

uggla commented Dec 14, 2021

No worries @borntyping. I'm happy this is implemented, now I can use the new version. 👍

@A248
Copy link

A248 commented Jan 11, 2022

@borntyping Would you be open to re-considering this as a feature flag? It adds unnecessary boilerplate to initialize with the utc_timestamps() method across many executables.

I would further suggest making UTC the default time display, so that users are not surprised by error messages arising from failed attempts to retrieve the local offset. Using time-rs's local offset feature seems fragile across different situations.

@borntyping
Copy link
Owner

I'm not sure I understand how a feature in Cargo.toml would be less boilerplate than the utc_timestamps() method?

Much as I'm frustrated with this entire situation, changing the default from local time to UTC time is a breaking change I'm not willing to make - it's too easy for users to miss when upgrading, and it may not be possible to identify that something has changed from logs that cover multiple invovations of a program using this.

If there was a way to make it the default for new users but not existing users I'd take it, but I can't think of any good solution here beyond waiting for Rust to stablilze a safer environment variable API and time to update to use it.

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.

"Could not determine the UTC offset on this system" and defaulting to UTC timestamps
3 participants