mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
Fix duplicated logging if log dir is not set (#6342)
This commit is contained in:
parent
6c0531683f
commit
9cc0ecc6ff
1 changed files with 2 additions and 5 deletions
|
@ -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<int>(severity_threshold_);
|
||||
i <= static_cast<int>(RayLogLevel::FATAL); ++i) {
|
||||
int level = GetMappedSeverity(static_cast<RayLogLevel>(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_;
|
||||
|
|
Loading…
Add table
Reference in a new issue