From eb66db3199cb4fcc027f8c80d5f1833ae85bb9a4 Mon Sep 17 00:00:00 2001 From: Lixin Wei Date: Sat, 29 Aug 2020 00:17:08 +0800 Subject: [PATCH] [Build] bug fixed for logging (#10364) --- src/ray/util/logging.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ray/util/logging.cc b/src/ray/util/logging.cc index cb3b06f5c..63e82ec65 100644 --- a/src/ray/util/logging.cc +++ b/src/ray/util/logging.cc @@ -173,12 +173,12 @@ void RayLog::StartRayLog(const std::string &app_name, RayLogLevel severity_thres log_dir_ = log_dir; #ifdef RAY_USE_GLOG google::InitGoogleLogging(app_name_.c_str()); - // Enable log file if log_dir_ is not empty. - std::string dir_ends_with_slash = log_dir_; - if (!ray::IsDirSep(log_dir_[log_dir_.length() - 1])) { - dir_ends_with_slash += ray::GetDirSep(); - } if (!log_dir_.empty()) { + // Enable log file if log_dir_ is not empty. + std::string dir_ends_with_slash = log_dir_; + if (!ray::IsDirSep(log_dir_[log_dir_.length() - 1])) { + dir_ends_with_slash += ray::GetDirSep(); + } std::string app_name_without_path = app_name; if (app_name.empty()) { app_name_without_path = "DefaultApp";