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

log: export std? #5453

Closed
localvar opened this issue May 13, 2013 · 2 comments
Closed

log: export std? #5453

localvar opened this issue May 13, 2013 · 2 comments

Comments

@localvar
Copy link

the standard logger is easy to use at most of time.

however, sometime, I'd like my program to select a logger at runtime (including the
standard logger), but I cannot use the 'standard' log in this case and had to create a
new 'standard' logger.

so, I suggest to export 'log.std' and my problem can be easily resolved.

Thanks.
@robpike
Copy link
Contributor

robpike commented May 13, 2013

Comment 2:

It's easy to create a new Logger.

Labels changed: removed priority-triage.

Status changed to WorkingAsIntended.

@localvar
Copy link
Author

Comment 3:

I understand it is easy to create new Logger. However, it also easy to export 'log.std',
for example, using below piece of code
func Standard() *Logger {
  return &std
}
And my program can use it as below:
logger := log.Standard()
if some_condition {
   logger = log.New(...)
}
It won't impact any existing code. And developers can avoid create a new Logger while
there's already one.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants