提交 065e9e6a 编写于 作者: F fary86

Fix when not set GLOG_log_dir, create log file at /tmp

上级 99e7e43c
......@@ -252,9 +252,13 @@ void mindspore_log_init(void) {
if (mindspore::GetEnv("GLOG_logfile_mode").empty()) {
FLAGS_logfile_mode = 0640;
}
std::string logtostderr = mindspore::GetEnv("GLOG_logtostderr");
// default print log to screen
if (mindspore::GetEnv("GLOG_logtostderr").empty()) {
if (logtostderr.empty()) {
FLAGS_logtostderr = true;
} else if (logtostderr == "0" && mindspore::GetEnv("GLOG_log_dir").empty()) {
FLAGS_logtostderr = true;
MS_LOG(WARNING) << "`GLOG_log_dir` is not set, output log to screen.";
}
#else
mindspore::InitMsLogLevel();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册