modules: openthread: platform: logging: Take kconfig into account
Currently all calls to otPlatLog with debug log level are printed. Cleanup logging.c Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
2a1bcc2919
commit
9983ff708e
1 changed files with 2 additions and 8 deletions
|
@ -5,16 +5,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
|
#include <zephyr/logging/log_core.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <openthread/platform/logging.h>
|
#include <openthread/platform/logging.h>
|
||||||
#include "openthread-core-zephyr-config.h"
|
|
||||||
|
|
||||||
#define LOG_MODULE_NAME net_openthread
|
|
||||||
#define LOG_LEVEL LOG_LEVEL_DBG
|
|
||||||
#include <zephyr/logging/log.h>
|
|
||||||
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
|
|
||||||
|
|
||||||
#include "platform-zephyr.h"
|
#include "platform-zephyr.h"
|
||||||
|
|
||||||
|
@ -49,7 +43,7 @@ void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat
|
||||||
int level = log_translate(aLogLevel);
|
int level = log_translate(aLogLevel);
|
||||||
va_list param_list;
|
va_list param_list;
|
||||||
|
|
||||||
if (level < 0) {
|
if (level < 0 || level > CONFIG_OPENTHREAD_PLATFORM_LOG_LEVEL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue