Skip to content

Conversation

harbourlga
Copy link
Contributor

@harbourlga harbourlga commented Jul 3, 2024

Description (what this PR does / why we need it):

  • The zap log plug-in implemented for contrib/log currently filters unnecessary log levels after the log information is formatted, which will cause a lot of additional overhead.
  • Referring to the implementation of SugaredLogger, it will first determine whether the log level meets the current needs before formatting the string.

Which issue(s) this PR fixes (resolves / be part of):

None

Other special notes for the reviewers:

None

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 3, 2024
@harbourlga harbourlga force-pushed the feat/zap-log-levelfiltering branch from 6fb5b8e to 97d04f0 Compare July 3, 2024 06:57
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jul 3, 2024
@harbourlga harbourlga changed the title chore(contrib/log/zap): If disable this level of logging entirely, av… feat(contrib/log/zap): If disable this level of logging entirely, av… Jul 3, 2024
@harbourlga harbourlga force-pushed the feat/zap-log-levelfiltering branch from 97d04f0 to 982b998 Compare July 3, 2024 07:00
shenqidebaozi
shenqidebaozi previously approved these changes Aug 28, 2024
@dosubot dosubot bot added the LGTM label Aug 28, 2024
…id additional overhead

  * goimports

* gofmt

* third-party packages should be placed before github.com/go-kratos
@harbourlga harbourlga force-pushed the feat/zap-log-levelfiltering branch from f927e8e to 17876b5 Compare September 2, 2024 01:40
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Sep 2, 2024
@shenqidebaozi shenqidebaozi merged commit 6963a8a into go-kratos:main Sep 2, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants