From 9cc0ecc6ffa5f6930db1d3dcf690883154a26097 Mon Sep 17 00:00:00 2001 From: Kai Yang Date: Sun, 15 Dec 2019 13:29:36 +0800 Subject: [PATCH] Fix duplicated logging if log dir is not set (#6342) --- src/ray/util/logging.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ray/util/logging.cc b/src/ray/util/logging.cc index 32921be17..27425b342 100644 --- a/src/ray/util/logging.cc +++ b/src/ray/util/logging.cc @@ -140,11 +140,8 @@ void RayLog::StartRayLog(const std::string &app_name, RayLogLevel severity_thres google::InitGoogleLogging(app_name_.c_str()); if (log_dir_.empty()) { google::SetStderrLogging(GetMappedSeverity(RayLogLevel::ERROR)); - for (int i = static_cast(severity_threshold_); - i <= static_cast(RayLogLevel::FATAL); ++i) { - int level = GetMappedSeverity(static_cast(i)); - google::base::SetLogger(level, &stdout_logger_singleton); - } + int level = GetMappedSeverity(severity_threshold_); + google::base::SetLogger(level, &stdout_logger_singleton); } else { // Enable log file if log_dir_ is not empty. auto dir_ends_with_slash = log_dir_;