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

Add Must(*Logger, error) *Logger function #1105

Merged
merged 3 commits into from
Jun 3, 2022
Merged

Add Must(*Logger, error) *Logger function #1105

merged 3 commits into from
Jun 3, 2022

Conversation

craigpastro
Copy link
Contributor

Resolves #640.

@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #1105 (bc7325e) into master (41970cf) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1105      +/-   ##
==========================================
- Coverage   98.36%   98.27%   -0.10%     
==========================================
  Files          49       49              
  Lines        2142     2145       +3     
==========================================
+ Hits         2107     2108       +1     
- Misses         27       28       +1     
- Partials        8        9       +1     
Impacted Files Coverage Δ
logger.go 96.61% <100.00%> (+0.08%) ⬆️
zapcore/sampler.go 96.22% <0.00%> (-3.78%) ⬇️

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 41970cf...bc7325e. Read the comment docs.

// var logger := zap.Must(zap.NewProduction())
func Must(logger *Logger, err error) *Logger {
if err != nil {
panic(err)
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the PR! Can you add a quick test to cover this branch, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test added in parallel. haha. Thanks!

Copy link
Member

@mway mway left a comment

Choose a reason for hiding this comment

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

Thanks!

@mway mway merged commit e06e09a into uber-go:master Jun 3, 2022
@craigpastro craigpastro deleted the add-must branch June 3, 2022 17:35
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.

Add a Must function to zap
2 participants