From cc5c78b1da023b324b466bae6637304a871c16a1 Mon Sep 17 00:00:00 2001 From: Qing Wang Date: Tue, 6 Aug 2019 04:26:09 +0800 Subject: [PATCH] Fix the issue of not initializing GLOG --- src/ray/util/logging.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ray/util/logging.cc b/src/ray/util/logging.cc index 1e2a95408..7311181c1 100644 --- a/src/ray/util/logging.cc +++ b/src/ray/util/logging.cc @@ -120,6 +120,7 @@ void RayLog::StartRayLog(const std::string &app_name, RayLogLevel severity_thres app_name_ = app_name; log_dir_ = log_dir; #ifdef RAY_USE_GLOG + google::InitGoogleLogging(app_name_.c_str()); int mapped_severity_threshold = GetMappedSeverity(severity_threshold_); google::SetStderrLogging(mapped_severity_threshold); // Enable log file if log_dir_ is not empty. @@ -138,7 +139,6 @@ void RayLog::StartRayLog(const std::string &app_name, RayLogLevel severity_thres app_name_without_path = app_name.substr(pos + 1); } } - google::InitGoogleLogging(app_name_.c_str()); google::SetLogFilenameExtension(app_name_without_path.c_str()); for (int i = static_cast(severity_threshold_); i <= static_cast(RayLogLevel::FATAL); ++i) {