-
Notifications
You must be signed in to change notification settings - Fork 6
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] debug log in init functions would never show #60
Labels
Milestone
Comments
at15
added a commit
to benchhub/benchhub
that referenced
this issue
Feb 26, 2018
- the log is not shown because debug level log in `init` function would never show, the logging level is adjusted after `init` function is called, dyweb/gommon#60 need to change default logging level at compile time to allow debug log in `init` ... - this also applies to package level variables, which are created before init function (..right?)
one way to avoid using ldflag is check a fixed environment variable like |
at15
added a commit
that referenced
this issue
Apr 27, 2019
- previously the default is hard coded to info level, which is fine until you start adding debug level log in `init` func, normally when you change log level use command flag, the `SetLevel` is called in main package, at that time, all the `init` has being called - by using env var, the gommon/log package itself's `init` can check environment variable directly, since all the packages that use gommon log have their `init` called **after** gommon's, even if they use debug in `init` they can still see the message if they set the correct level in environment variable - it is not tested, might need to add e2e test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
because cli set the level after the init functions has been called ...
we should be able to enable that by setting the default level using ldflag, so even debug in
init
function would workThe text was updated successfully, but these errors were encountered: