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: migrate from logrus to zap, while keeping almost the same API #76

Closed
wants to merge 2 commits into from

Conversation

bendiknesbo
Copy link
Contributor

@bendiknesbo bendiknesbo commented Dec 29, 2023

Note that creation of logger has changed a bit, and .Info(,.Warn( etc no longer accepts args ...interface{}, but rather msg string (We still have .Infof(format string, args ...interface()). This is just an experiment, and we could of course keep the existing API.

Note: There is no need to migrate to zap/zerolog or any other of the no-allocation speedy loggers if we are going to use go-logger the way we do today. This will just incur the same allocation-cost Logrus does, and then we can simply keep Logrus.

Logging (from global logger) an error-message with a custom field takes around 2000-3000 ns on my MacBook M2, which is 0.002 ms, which is negligable for the workloads we are running.

@bendiknesbo
Copy link
Contributor Author

Superseded by #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant