-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
chore: rename log pkg and add zerolog #14955
Conversation
|
||
// ZeroLogWrapper provides a wrapper around a zerolog.Logger instance. It implements | ||
// Tendermint's Logger interface. | ||
type ZeroLogWrapper struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have a ZeroLogWrapper
? This defeats the purpose of using zerolog (with the way it's currently implemented).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually re-adds it as it was in server before this PR: #13236.
So then we can implement filtering. I have not changed the implementation. (see todo above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes yes, I recall (I wrote it :P) but what I'm asking is that we removed it for a reason and now we're adding it back. Why are we adding it back? It's not performant nor does it give us any of the benefits of zerolog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was removed because it didn't have filtered logging.
AFAIK it was still more performant that the TM logger and re-added it to have a base.
If it should be deleted, then sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the filtering was missing indeed. But I'm pretty sure it was less performant I think. There's an issue lingering around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface provided by comet will be replaced to what we want after we migrate the repo.
How? You've convinced them to adopt our logging interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've convinced them to adopt our logging interface?
I was thinking we do a wrapper of our logger where we pass it to tendermint. there is no need for us to have the same interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but at some point you will have to pass a logger to Comet and that logger must conform to Comet's interface. In essence, we'll have two loggers being used -- one for Comet and one for the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, at that point we just provide a wrapper that is separate from our interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @julienrbrt we should call the logger CometZerologWrapper
IMO
Description
ref: #14872 (comment)
A follow-up PR will remove:Used replaces to do it now and split them all in two groups btw, so that it is clearer what should stay or not when refactoring.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change