Add --log-timestamp-utc flag for UTC log timestamps#8915
Closed
frederik12321 wants to merge 1 commit into
Closed
Conversation
|
frederik seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Frederik seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
5576d91 to
e2674e1
Compare
Add a `--log-timestamp-utc` CLI flag that switches text log timestamps from local time to UTC. After the tracing migration, text logs default to local time, which resolved the original complaint. This flag gives operators who prefer UTC (for slot comparison or multi-timezone debugging) an explicit opt-in. JSON log timestamps remain UTC regardless of this flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e2674e1 to
b254e5a
Compare
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #3130
--log-timestamp-utcCLI flag that switches text log timestamps from local time to UTCLocal::now()), which resolved the original complaint about forced UTCUtc::now()with RFC3339 format) regardless of this flagImplementation
Threads a
log_timestamp_utc: boolfield throughLoggerConfig→init_tracing()→LoggingLayer. When the flag is set,on_event()usesUtc::now()instead ofLocal::now()for the text format timestamp.SSE and libp2p/discv5 logging layers are left unchanged (local time) as they serve the GUI and internal debugging respectively.
Test plan
cargo checkpasses with zero errors/warningscargo fmt --allproduces no diffsmake lint(clippy) passes with zero warningslighthouse bn --log-timestamp-utcand verify timestamps show UTC🤖 Generated with Claude Code