-
Notifications
You must be signed in to change notification settings - Fork 3
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
configuration: add logging section & ad log_level to configuration_opts #50
configuration: add logging section & ad log_level to configuration_opts #50
Conversation
As there is new code introduced, please also provide tests to check the funtionallity. |
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.
Please adapt as proposed
3b3e866
to
d2bf861
Compare
Refactored for testability and added test. |
d2bf861
to
6cbc257
Compare
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.
There are some flake8
errors and warnings in your PR. It would be great if you can fix this too.
Allow to configure both the logging-levels and targets of various loggers by adding a new section `logging` to the configuration file. Each entry in that section configures one logger / channel. An example config is: ```yaml logging: - name root level: INFO - name: foomodule.barcollector: level: WARNING target: /path/to/my/collector/logfile.log ```
Add `CollectorBase.setLoggers(logger_names)` as a means for collectors derived from `CollectorBase` to easily configure logging-levels. The new method uses the `collector_opts.logging_level` value (if set in the configuration) to set the logging-level of any loggers given to it.
6cbc257
to
0ea72f6
Compare
Allow to configure both the logging-levels and targets of various loggers by adding a new section
logging
to the configuration file. Each entry in that section configures one logger / channel. An example config is:Add
CollectorBase.setLoggers(logger_names)
as a means for collectors derived fromCollectorBase
to easily configure logging-levels. The new method uses thecollector_opts.logging_level
value (if set in the configuration) to set the logging-level of any loggers given to it.