-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Implemented disabling logging configuration & added config file #1130
Implemented disabling logging configuration & added config file #1130
Conversation
Do you have any suggestions for how tests should be implemented for such changes? What about documentation? |
for testing, i think these are good examples hydra/tests/test_examples/test_configure_hydra.py Lines 72 to 90 in 180ec59
For documentation, the Hydra confs are already linked here https://hydra.cc/docs/next/configure_hydra/intro, so i think it's probably fine not to document it. |
Thx for working on this! Please fix the lint failures. Other than that, one small comment. |
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.
Some feedback
Nice.
|
news/1130.feature
Outdated
@@ -0,0 +1 @@ | |||
This change will allow disabling the configuration of Python's logging subsystem. |
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.
Maybe something like the following? (to be more consistent with the other news entries, also no comma at the end.)
It is now possible to disable Hydra's logging configuration
Co-authored-by: Jieru Hu <[email protected]>
```commandline | ||
$ python my_app.py hydra/job_logging=disabled | ||
<NO OUTPUT> | ||
``` | ||
|
||
Logging can be [customized](/configure_hydra/logging.md). | ||
You can also set `hydra/job_logging=none` and `hydra/hydra_logging=none` if you do not want Hydra to configure the logging. | ||
and `hydra/hydra_logging` to `none` |
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.
redundant line?
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.
They're separate things: disabled
disables the Python logging system such that any pre-existing loggers will also be disabled, while none
disables the logging configuration that Hydra sets up. On another note, I did find that the documentation in general was a bit confusing since certain topics were described multiple times in multiple different places. Perhaps the documentation should be changed in general?
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.
I was referring to this part:
Hydra to configure the logging.
and `hydra/hydra_logging` to `none`
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.
Great, thanks!
Motivation
Implemented disabling the configuration for Python logging, as described in #1021. Added
notset.yaml
configuration file for hydra/hydra_logging and hydra/job_logging.Have you read the Contributing Guidelines on pull requests?
(Yes)/No
Test Plan
I tested my implementation locally by comparing the root logger's state before and after
hydra.main
. I wasn't sure how to write that and add it to the test suite.Related Issues and PRs
N/A