[Build] bug fixed for logging (#10364)

This commit is contained in:
Lixin Wei
2020-08-29 00:17:08 +08:00
committed by GitHub
parent 68c2dcd12b
commit eb66db3199
+5 -5
View File
@@ -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";