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

chore: rename log pkg and add zerolog #14955

Merged
merged 8 commits into from
Feb 8, 2023
Merged

chore: rename log pkg and add zerolog #14955

merged 8 commits into from
Feb 8, 2023

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Feb 8, 2023

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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@julienrbrt julienrbrt requested a review from a team as a code owner February 8, 2023 10:06
@julienrbrt julienrbrt changed the title chore: rename log and zerolog chore: rename log and add zerolog Feb 8, 2023
@github-actions github-actions bot added the C:log label Feb 8, 2023
log/go.mod Show resolved Hide resolved
@julienrbrt julienrbrt changed the title chore: rename log and add zerolog chore: rename log pkg and add zerolog Feb 8, 2023
@julienrbrt julienrbrt enabled auto-merge (squash) February 8, 2023 10:57
@julienrbrt julienrbrt enabled auto-merge (squash) February 8, 2023 11:10
@github-actions github-actions bot added C:Confix Issues and PR related to Confix C:x/circuit labels Feb 8, 2023
@julienrbrt julienrbrt merged commit a7ac29e into main Feb 8, 2023
@julienrbrt julienrbrt deleted the julien/rename-log branch February 8, 2023 11:32

// ZeroLogWrapper provides a wrapper around a zerolog.Logger instance. It implements
// Tendermint's Logger interface.
type ZeroLogWrapper struct {
Copy link
Contributor

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).

Copy link
Member Author

@julienrbrt julienrbrt Feb 8, 2023

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)

Copy link
Contributor

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

Copy link
Member Author

@julienrbrt julienrbrt Feb 8, 2023

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!

Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Member

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.

#14967

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor

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

@julienrbrt julienrbrt mentioned this pull request Feb 10, 2023
6 tasks
tsenart pushed a commit to meka-dev/cosmos-sdk that referenced this pull request Apr 12, 2023
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
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.

3 participants