[WIP] Implement global logging configuration #34179
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes how the logging configuration for Ray is set, and changes the format of log messages.
Why are these changes needed?
Changes
ray/log.py
.ray/__init__.py
at the top of the module. Subsequent calls to the configuration are ignored.ray.rllib
is configured at the WARN level, to address Revert "Simplify logging configuration. (#30863)" #31858. With this change,Revert "Simplify logging configuration. (#30863)" #31858 can be reverted, again simplifying and consolidating logging configuration.
test_output.py::test_logger_config
to test only the logger config, not launch a ray cluster. The test was failing intermittently, I think due to a race condition between the launch of the cluster and the reading of the subprocess's stdout, and anyway it wasn't necessary to callray.init
here to check that logging was configured correctly.python/ray/tune/tests/test_commands.py::test_ls_with_cfg
to test the underlying data, not what gets printed to stdout (which has changed with the new logging system).ray.tune.automl.search_policy.AutoMLSearcher.on_trial_complete
, which in certain cases emits a logging message which tries to format aNoneType
into a%f
during log message formatting. This was a previously-undetected bug which showed up because the default log level is nowINFO
. This fixes a test that was failing intest_automl_searcher.py::AutoMLSearcherTest
.Related issue number
Partially addresses #30005. Originally merged in #32741, this was reverted in #34126 because it broke doctests. This is a second try.
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.