Resolve no handlers could be found for logger 'ray.worker' when importing ray (#3483)

This commit is contained in:
Tianming Xu
2018-12-07 12:46:53 +08:00
committed by Eric Liang
parent 8395523f81
commit f6490f9bef
+9 -6
View File
@@ -76,10 +76,6 @@ try:
import setproctitle
except ImportError:
setproctitle = None
logger.warning(
"WARNING: Not updating worker name since `setproctitle` is not "
"installed. Install this with `pip install setproctitle` "
"(or ray[debug]) to enable monitoring of worker processes.")
class RayTaskError(Exception):
@@ -1685,6 +1681,10 @@ def init(redis_address=None,
Exception: An exception is raised if an inappropriate combination of
arguments is passed in.
"""
if configure_logging:
logging.basicConfig(level=logging_level, format=logging_format)
# Add the use_raylet option for backwards compatibility.
if use_raylet is not None:
if use_raylet:
@@ -1694,8 +1694,11 @@ def init(redis_address=None,
raise DeprecationWarning("The use_raylet argument is deprecated. "
"Please remove it.")
if configure_logging:
logging.basicConfig(level=logging_level, format=logging_format)
if setproctitle is None:
logger.warning(
"WARNING: Not updating worker name since `setproctitle` is not "
"installed. Install this with `pip install setproctitle` "
"(or ray[debug]) to enable monitoring of worker processes.")
if global_worker.connected:
if ignore_reinit_error: