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(log): wire logger filtering #15601

Merged
merged 20 commits into from
Mar 30, 2023
Merged

feat(log): wire logger filtering #15601

merged 20 commits into from
Mar 30, 2023

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Mar 29, 2023

Description

Closes: #15366

I have introduced log options, to make it more customizable and reduce the need of using NewCustomLogger for commonly used options.
I like the UX of variadic options: it allows us to add functionalities, without being API breaking or adding a dozen constructors. It cleaned up the logger creation in server too.

After this PR, I will be tagging cosmossdk.io/log v1.0.0.


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)

log/writer.go Outdated Show resolved Hide resolved
@julienrbrt julienrbrt marked this pull request as ready for review March 29, 2023 15:55
@julienrbrt julienrbrt requested a review from a team as a code owner March 29, 2023 15:55
@julienrbrt julienrbrt marked this pull request as draft March 29, 2023 16:28
@github-actions github-actions bot added C:Cosmovisor Issues and PR related to Cosmovisor C:log C:Rosetta Issues and PR related to Rosetta labels Mar 29, 2023
@julienrbrt julienrbrt changed the title feat: wire logger filtering feat(log): wire logger filtering Mar 29, 2023
@julienrbrt julienrbrt marked this pull request as ready for review March 29, 2023 17:55
@github-prbot github-prbot requested review from a team, aaronc and JeancarloBarrios and removed request for a team March 29, 2023 17:55
@julienrbrt julienrbrt requested review from tac0turtle and mark-rushakoff and removed request for aaronc and JeancarloBarrios March 29, 2023 18:21
Copy link
Member

@mark-rushakoff mark-rushakoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple style details to clean up, but this otherwise looks all correct to me.

log/logger.go Outdated Show resolved Hide resolved
log/logger.go Outdated Show resolved Hide resolved
log/options.go Show resolved Hide resolved
log/options.go Show resolved Hide resolved
log/writer.go Outdated Show resolved Hide resolved
log/writer_test.go Outdated Show resolved Hide resolved
log/writer_test.go Outdated Show resolved Hide resolved
Copy link
Member

@mark-rushakoff mark-rushakoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing those cleanups.

@julienrbrt julienrbrt force-pushed the julien/filter-logger branch from 8eadb57 to 2c3139a Compare March 29, 2023 19:52
@julienrbrt julienrbrt enabled auto-merge (squash) March 29, 2023 19:53
log/CHANGELOG.md Outdated Show resolved Hide resolved
@julienrbrt julienrbrt merged commit d21f58c into main Mar 30, 2023
@julienrbrt julienrbrt deleted the julien/filter-logger branch March 30, 2023 09:48
@faddat faddat mentioned this pull request Mar 30, 2023
19 tasks
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
Labels
C:Cosmovisor Issues and PR related to Cosmovisor C:log C:Rosetta Issues and PR related to Rosetta C:Store
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wire filtering in logger
3 participants