Browse Source

!6510 [MS][LITE]fix log output has 10

Merge pull request !6510 from yeyunpeng2020/log
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
5c2597850b
1 changed files with 6 additions and 11 deletions
  1. +6
    -11
      mindspore/lite/src/common/log_adapter.cc

+ 6
- 11
mindspore/lite/src/common/log_adapter.cc View File

@@ -24,7 +24,7 @@
#include <android/log.h>
#endif

// namespace to support utils module definitionnamespace mindspore constexpr const char *ANDROID_LOG_TAG = "MS_LITE";
// namespace to support utils module definition namespace mindspore constexpr const char *ANDROID_LOG_TAG = "MS_LITE";
namespace mindspore {
constexpr const char *ANDROID_LOG_TAG = "MS_LITE";

@@ -109,18 +109,13 @@ static std::string ExceptionTypeToString(ExceptionType type) {
}

void LogWriter::OutputLog(const std::ostringstream &msg) const {
if (IsPrint(log_level_)) {
std::string sm = "";
if (submodule_ != SM_UNKNOWN) {
sm = std::to_string(submodule_) + " ";
}
// #ifdef USE_ANDROID_LOG
if (IsPrint(log_level_) && submodule_ != SM_UNKNOWN) {
#ifdef ENABLE_ARM
__android_log_print(GetAndroidLogLevel(log_level_), ANDROID_LOG_TAG, "[%s:%d] %s] %s%s", location_.file_,
location_.line_, location_.func_, sm.c_str(), msg.str().c_str());
__android_log_print(GetAndroidLogLevel(log_level_), ANDROID_LOG_TAG, "[%s:%d] %s] %s", location_.file_,
location_.line_, location_.func_, msg.str().c_str());
#else
printf("%s [%s:%d] %s] %s%s\n", EnumStrForMsLogLevel(log_level_), location_.file_, location_.line_, location_.func_,
sm.c_str(), msg.str().c_str());
printf("%s [%s:%d] %s] %s\n", EnumStrForMsLogLevel(log_level_), location_.file_, location_.line_,
location_.func_, msg.str().c_str());
#endif
}
}


Loading…
Cancel
Save