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

feat: create zap logger on demand #269

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lebauce
Copy link

@lebauce lebauce commented Oct 30, 2023

Importing one package causes a logger to be created and Zap logger has a non negligible cost (a few hundred Kilobytes).

This PR simply defers the creation of the logger when it's actually used.

@knqyf263
Copy link
Collaborator

Are you in a hurry? We're planning to replace zap with slog after Go 1.22 is out. This is because we have a policy supporting the two latest Go versions, and slog was added in Go 1.21.

@lebauce
Copy link
Author

lebauce commented Oct 31, 2023

@knqyf263 Thanks for the notice ! I can definitely wait

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