-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
shared or main logger #6
Comments
|
Not in mu case. For example: I have two packages or I set SetTimeFormat on main and use glog on different package the config is not global to both package. What will be the best way to set it once "globally" ? |
This can't be done via the package alone atm, you mean two different applications? You need a way to communicate and link those apps in order to send and receive messages, if the apps can run in different machines you can do it via tcp. Or I didn't understand correctly? |
Normally will use applications with support of data streaming for the logging but maybe this is not your case, I want to implement that, you gave me a new idea right now (I'm designing a new package the last weeks which can give us this feature to the |
Looks like golog.Default is the way.. I guess it is using sync.Once. I thought using golog.Child but this might be "abuse" to create two global loggers. BTW, the order of golog.Child and golog.Handle is important. if golog.Handle is set first and then golog.Child.Handle is second the config of golog.Child.Handle will be ignored the opposite works. This is ok:
This is not ok:
|
Yes, if you mean two packages, it's the |
Hello,
Thanks for this library.
What is the best way to share logger between different packages for example main has package One, Two, Three what will be the best to share the same logger (same config) ?
The text was updated successfully, but these errors were encountered: