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

Improve custom logger: Use stdlib's existing logger variable by default #147

Merged
merged 1 commit into from
Mar 4, 2019

Conversation

VojtechVitek
Copy link
Collaborator

@VojtechVitek VojtechVitek commented Mar 4, 2019

Follow-up on #105. Don't allocate new stdlib's logger and reuse
the default logger (unexported) variable. This will enable people
make custom changes to the std logger, ie. log.SetFlags(),
log.SetPrefix() or log.SetOutput() without having to duplicate
the same code and applying it to goose logger.

Note: I wish Go made the std logger an interface soon. They might plan it for Go 2, but who knows when it will land.. golang/go#13182

Follow-up on #105. Don't allocate new stdlib's logger and reuse
the default logger (unexported) variable. This will enable people
make custom changes to the std logger, ie. log.SetFlags(),
log.SetPrefix() or log.SetOutput() without having to duplicate
the same code and applying it to goose logger.
Copy link
Collaborator

@mfridman mfridman left a comment

Choose a reason for hiding this comment

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

lgtm. @VojtechVitek consider adding Fatalln for brevity.

@VojtechVitek VojtechVitek merged commit 53b79a1 into master Mar 4, 2019
@VojtechVitek VojtechVitek deleted the stdlogger branch March 4, 2019 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants