Skip to content

Conversation

gavinbunney
Copy link
Contributor

When zerolog has been setup to add a timestamp to all log messages, slog messages end up with two time fields:

zerologLogger := zerolog.New(os.Stderr).With().Timestamp().Stack().Logger()

# zerolog only
{"level":"info","time":"2024-06-21T09:45:11.54072-07:00","message":"Some message"}

# slog + zerolog
{"level":"info","time":"2024-06-21T09:45:11.540919-07:00","time":"2024-06-21T09:45:11.540933-07:00","message":"Some message"}

This adds an option to not append the timestamp for these cases

@samber samber merged commit ad8a57e into samber:main Jun 22, 2024
@samber
Copy link
Owner

samber commented Jun 22, 2024

LGTM

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.

2 participants