提交 e87721d8 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!1270 modify log level

Merge pull request !1270 from fary86/change_logging_level
......@@ -248,8 +248,20 @@ enum LogConfigToken {
VARIABLE, // '[A-Za-z][A-Za-z0-9_]*'
NUMBER, // [0-9]+
COMMA, // ','
COLON, // ';'
COLON, // ':'
EOS, // End Of String, '\0'
NUM_LOG_CFG_TOKENS
};
static const char *g_tok_names[NUM_LOG_CFG_TOKENS] = {
"invalid", // indicate invalid token
"{", // '{'
"}", // '}'
"variable", // '[A-Za-z][A-Za-z0-9_]*'
"number", // [0-9]+
",", // ','
":", // ':'
"end-of-string", // End Of String, '\0'
};
static inline bool IsAlpha(char ch) { return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); }
......@@ -347,7 +359,8 @@ class LogConfigParser {
bool Expect(LogConfigToken expected, LogConfigToken tok) {
if (expected != tok) {
MS_LOG(ERROR) << "Expect " << expected << ", but got " << tok;
MS_LOG(WARNING) << "Parse submodule log configuration text error, expect `" << g_tok_names[expected]
<< "`, but got `" << g_tok_names[tok] << "`. The whole configuration will be ignored.";
return false;
}
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册