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 option to not append timestamp to logs #4

Merged
merged 1 commit into from
Jun 22, 2024
Merged

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
2 checks passed
@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