mirror of
https://github.com/espressif/openthread.git
synced 2026-09-17 06:30:10 +00:00
[log] implement new logging model with module name support (#7385)
This commit implements new logging model in OpenThread. Each core module can specify its own module name using `RegisterLogModule()`. The registered log module name is then included in the all the log messages emitted from the specific file. This model replaces and enhances the log region model.
This commit is contained in:
@@ -33,11 +33,11 @@
|
||||
|
||||
#include <openthread-system.h>
|
||||
#include <openthread/cli.h>
|
||||
#include <openthread/logging.h>
|
||||
|
||||
#include "cli/cli_config.h"
|
||||
#include "common/code_utils.hpp"
|
||||
#include "common/debug.hpp"
|
||||
#include "common/logging.hpp"
|
||||
#include "utils/uart.h"
|
||||
|
||||
#if OPENTHREAD_POSIX
|
||||
|
||||
@@ -150,21 +150,13 @@ pseudo_reset:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Provide, if required an "otPlatLog()" function
|
||||
*/
|
||||
#if OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_APP
|
||||
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, aFormat);
|
||||
otCliPlatLogv(aLogLevel, aLogRegion, aFormat, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void otPlatLogLine(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aLogLine)
|
||||
{
|
||||
otCliPlatLogLine(aLogLevel, aLogRegion, aLogLine);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user