-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Set default log level via config #1987
Conversation
@riga, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dlstadther, @themalkolm and @Tarrasch to be potential reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason you don't set this using the core
config class? Then it could be automatically documented through the --help
flag. Also, a ChoiceParameter would check that you don't misspell the logging levels.
Would you consider to refactor into such an implementation?
Overall awesome patch. I have wanted this too sometimes. :) Oh, bonus points if you assert that if there's a config set to read the logging-config, then luigi shouldn't allow one to set this new config variable as it will not take affect. |
Like that? |
Exactly like that. :) |
Thanks @riga! :) |
Add default log level to core config and update docs.
Description
This PR allows for the configuration of the default log level, which is
DEBUG
by default.Motivation and Context
It might be a first world problem, but sometimes it would be nice to control the default log level without the need to create (and deploy) a logging config file, but rather by a simple environment variable. The value of this variable must match the name of a python logging level. Usage example:
An other option would be to add
default_log_level
to the core config and to prefer the environment variable if set (at least that's what most libs do).Tests
Too trivial to test :P
Docs
I couldn't find a place in the docs for this feature, but I sure can add a sentence or two to a section of your choice.