Skip to content

fix: omit ConsoleWriter timestamp when time field is absent#770

Open
leno23 wants to merge 1 commit into
rs:masterfrom
leno23:fix/console-writer-skip-missing-timestamp-725
Open

fix: omit ConsoleWriter timestamp when time field is absent#770
leno23 wants to merge 1 commit into
rs:masterfrom
leno23:fix/console-writer-skip-missing-timestamp-725

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Skip the timestamp part in ConsoleWriter when the JSON event has no time field
  • Update tests and add regression coverage for logs without .Timestamp()

Fixes #725

Test plan

  • go test ./...

Made with Cursor

Skip the timestamp part when the JSON event has no time field instead
of printing a literal <nil> prefix. This matches typical Docker setups
where Timestamp() is not chained on the logger.

Fixes rs#725

Co-authored-by: Cursor <[email protected]>
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.

<nil> timestamp when running in docker

1 participant