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

zap: Add ParseAtomicLevel func #1048

Merged
merged 2 commits into from Jan 14, 2022
Merged

zap: Add ParseAtomicLevel func #1048

merged 2 commits into from Jan 14, 2022

Conversation

Techassi
Copy link
Contributor

As discussed in #1047 this PR adds a zap.ParseAtomicLevel() func which enables the user to construct a log level based on ASCII text input.

Usage

level, err := zap.ParseAtomicLevel("info") // InfoLevel, nil

level, err := zap.ParseAtomicLevel("DEBUG") // DebugLevel, nil

level, err := zap.ParseAtomicLevel("FOO") // InfoLevel, "unrecognized level: "FOO""

@codecov
Copy link

codecov bot commented Jan 13, 2022

Codecov Report

Merging #1048 (ed6314c) into master (e751939) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1048   +/-   ##
=======================================
  Coverage   98.11%   98.12%           
=======================================
  Files          48       48           
  Lines        2074     2080    +6     
=======================================
+ Hits         2035     2041    +6     
  Misses         30       30           
  Partials        9        9           
Impacted Files Coverage Δ
level.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e751939...ed6314c. Read the comment docs.

level.go Outdated Show resolved Hide resolved
Co-authored-by: Sung Yoon Whang <sungyoonwhang@gmail.com>
@Techassi Techassi requested a review from sywhang January 14, 2022 08:37
Copy link
Contributor

@sywhang sywhang left a comment

Choose a reason for hiding this comment

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

Thank you for the contributions! 👍

@sywhang sywhang merged commit c087e07 into uber-go:master Jan 14, 2022
7 checks passed
@Techassi Techassi deleted the parse-atomic-level branch January 14, 2022 10:11
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.

None yet

2 participants