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

Logger, SugaredLogger: Add Level method #1148

Merged
merged 1 commit into from Aug 30, 2022
Merged

Logger, SugaredLogger: Add Level method #1148

merged 1 commit into from Aug 30, 2022

Conversation

abhinav
Copy link
Contributor

@abhinav abhinav commented Aug 15, 2022

Add a Level() Level method on Logger and SugaredLogger
that reports the current minimum enabled log level for the logger.

This relies on the zapcore.LevelOf function added in #1147.

Resolves #1144
Depends on #1147

@abhinav abhinav force-pushed the abg/logger-level branch 2 times, most recently from 85fa6f1 to 46c3194 Compare Aug 15, 2022
Base automatically changed from abg/core-level to master Aug 16, 2022
@abhinav abhinav marked this pull request as ready for review Aug 24, 2022
@abhinav
Copy link
Contributor Author

abhinav commented Aug 24, 2022

Ready for review now that LevelOf has been released.

Add a `Level() Level` method on Logger and SugaredLogger
that reports the current minimum enabled log level for the logger.

This relies on the zapcore.LevelOf function added in #1147.

Resolves #1144
@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #1148 (9cecbb8) into master (1ae5819) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1148   +/-   ##
=======================================
  Coverage   98.33%   98.33%           
=======================================
  Files          49       49           
  Lines        2163     2165    +2     
=======================================
+ Hits         2127     2129    +2     
  Misses         28       28           
  Partials        8        8           
Impacted Files Coverage Δ
logger.go 96.69% <100.00%> (+0.02%) ⬆️
sugar.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@abhinav abhinav requested review from mway and prashantv Aug 29, 2022
mway
mway approved these changes Aug 29, 2022
@abhinav abhinav merged commit eae3743 into master Aug 30, 2022
8 checks passed
@abhinav abhinav deleted the abg/logger-level branch Aug 30, 2022
@anitasec
Copy link

Hi @abhinav! I was wondering when there is going to be a new release including the new Level() method for the Logger. Thank you so much!

@mway
Copy link
Member

mway commented Nov 26, 2022

Hey @anitasec, I'll probably cut a new release on Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Getting level from zap logger
4 participants