feat: migrate from logrus to zap, while keeping almost the same API #76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note that creation of logger has changed a bit, and
.Info(
,.Warn(
etc no longer acceptsargs ...interface{}
, but rathermsg 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.