!34233 [MS][LITE][STABLE]print log to console by default
Merge pull request !34233 from chenjianping/master_dev2
This commit is contained in:
commit
3eee00eb0d
|
@ -594,9 +594,8 @@ MS_CORE_API void common_log_init(void) {
|
|||
}
|
||||
std::string logtostderr = mindspore::GetEnv("GLOG_logtostderr");
|
||||
// Default print log to screen
|
||||
if (logtostderr.empty()) {
|
||||
FLAGS_logtostderr = true;
|
||||
} else if (logtostderr == "0") {
|
||||
FLAGS_logtostderr = true;
|
||||
if (logtostderr == "0") {
|
||||
if (mindspore::GetEnv("GLOG_log_dir").empty()) {
|
||||
#ifndef BUILD_LITE_INFERENCE
|
||||
MS_LOG(ERROR) << "`GLOG_log_dir` is empty, it must be set while 'logtostderr' equals to 0.";
|
||||
|
@ -604,9 +603,9 @@ MS_CORE_API void common_log_init(void) {
|
|||
exit(EXIT_FAILURE);
|
||||
#else
|
||||
MS_LOG(WARNING) << "`GLOG_log_dir` is empty, log will be printed to stderr.";
|
||||
FLAGS_logtostderr = true;
|
||||
#endif
|
||||
} else {
|
||||
FLAGS_logtostderr = false;
|
||||
// Set log dir from GLOG_log_dir with RANK_ID or OMPI_COMM_WORLD_RANK.
|
||||
#ifndef BUILD_LITE_INFERENCE
|
||||
const std::string rank_id = mindspore::GetEnv("RANK_ID");
|
||||
|
|
|
@ -31,8 +31,12 @@ NUMAAdapter::NUMAAdapter() {
|
|||
available_ = false;
|
||||
handle_ = dlopen("libnuma.so", RTLD_LAZY | RTLD_LOCAL);
|
||||
if (handle_ == nullptr) {
|
||||
MS_LOG(WARNING) << "Does not support NUMA.";
|
||||
return;
|
||||
MS_LOG(WARNING) << "Open libnuma.so failed!try libnuma.so.1 again.";
|
||||
handle_ = dlopen("libnuma.so.1", RTLD_LAZY | RTLD_LOCAL);
|
||||
if (handle_ == nullptr) {
|
||||
MS_LOG(WARNING) << "Open numa so failed!";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
numa_interfaces_.numa_available = reinterpret_cast<int (*)(void)>(dlsym(handle_, "numa_available"));
|
||||
|
|
Loading…
Reference in New Issue