You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: