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

zaptest: Add possibility to pass zap.Option's #609

Closed
iaroslav-ciupin opened this issue Jul 17, 2018 · 1 comment
Closed

zaptest: Add possibility to pass zap.Option's #609

iaroslav-ciupin opened this issue Jul 17, 2018 · 1 comment

Comments

@iaroslav-ciupin
Copy link
Contributor

iaroslav-ciupin commented Jul 17, 2018

Synopsis

zaptest.NewLogger gives you possibility to set logging level using zaptest.Level(enab zapcore.LevelEnabler). It would be great to optionally add caller to test logger using something like:

logger := zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddLogger(), ...))

This should result in logging caller like so:

...
42: log.Info("received work order") 
43: // logs "INFO    zaptest/logger_test.go:42    received work order"

Pull request with suggested change: #610

@iaroslav-ciupin
Copy link
Contributor Author

iaroslav-ciupin commented Jul 27, 2018

Hi @akshayjshah , @prashantv ! Can you please have a look at this proposal(and PR with corresponding implementation) ? Thanks in advance.

@iaroslav-ciupin iaroslav-ciupin changed the title zaptest: Add possibility to log caller zaptest: Add possibility to pass zap.Option's Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant