mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
Fix logger initialization (#27238)
This commit is contained in:
parent
545c51609f
commit
467430dd55
2 changed files with 16 additions and 3 deletions
|
@ -1165,7 +1165,7 @@ def init(
|
|||
arguments is passed in.
|
||||
"""
|
||||
if configure_logging:
|
||||
setup_logger(logging_level, logging_format)
|
||||
setup_logger(logging_level, logging_format or ray_constants.LOGGER_FORMAT)
|
||||
|
||||
# Parse the hidden options:
|
||||
_enable_object_reconstruction: bool = kwargs.pop(
|
||||
|
@ -1192,8 +1192,6 @@ def init(
|
|||
_node_name: str = kwargs.pop("_node_name", None)
|
||||
# Fix for https://github.com/ray-project/ray/issues/26729
|
||||
_skip_env_hook: bool = kwargs.pop("_skip_env_hook", False)
|
||||
if not logging_format:
|
||||
logging_format = ray_constants.LOGGER_FORMAT
|
||||
|
||||
# If available, use RAY_ADDRESS to override if the address was left
|
||||
# unspecified, or set to "auto" in the call to init
|
||||
|
|
|
@ -14,6 +14,21 @@ from ray._private.test_utils import (
|
|||
)
|
||||
|
||||
|
||||
def test_logger_config():
|
||||
script = """
|
||||
import ray
|
||||
|
||||
ray.init(num_cpus=1)
|
||||
"""
|
||||
|
||||
proc = run_string_as_driver_nonblocking(script)
|
||||
out_str = proc.stdout.read().decode("ascii")
|
||||
err_str = proc.stderr.read().decode("ascii")
|
||||
|
||||
print(out_str, err_str)
|
||||
assert "INFO worker.py:" in err_str, err_str
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.")
|
||||
def test_spill_logs():
|
||||
script = """
|
||||
|
|
Loading…
Add table
Reference in a new issue