fix: 内核ERR级别及以上的打印输出当前进程和线程名

Signed-off-by: zff <zhangfanfan2@huawei.com>
This commit is contained in:
zhangfanfan2 2021-11-30 07:41:03 +00:00 committed by Gitee
parent ba8438257a
commit 540b2017c5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 1 deletions

View File

@ -40,6 +40,7 @@
#endif
#include "los_init.h"
#include "los_printf_pri.h"
#include "los_process_pri.h"
#ifdef LOSCFG_SHELL_LK
@ -189,7 +190,9 @@ VOID OsLkDefaultFunc(INT32 level, const CHAR *func, INT32 line, const CHAR *fmt,
return;
}
if ((level != LOS_COMMON_LEVEL) && ((level > LOS_EMG_LEVEL) && (level <= LOS_TRACE_LEVEL))) {
dprintf("[%s]", OsLogLvGet(level));
dprintf("[%s][%s:%s]", OsLogLvGet(level),
((OsCurrProcessGet() == NULL) ? "NULL" : OsCurrProcessGet()->processName),
((OsCurrTaskGet() == NULL) ? "NULL" : OsCurrTaskGet()->taskName));
}
LkDprintf(fmt, ap);
}