From 42c9807207f220438034c7320658b12fff8d51d2 Mon Sep 17 00:00:00 2001 From: Arto Kinnunen Date: Mon, 9 Nov 2020 10:55:28 +0200 Subject: [PATCH] Nanostak trace level configuration (#2489) Allow application to overwrite Nanostack trace level. --- mbed_lib.json | 4 ++++ source/nsconfig.h | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/mbed_lib.json b/mbed_lib.json index 1fddbd2cbac6..ce65c8a038a9 100644 --- a/mbed_lib.json +++ b/mbed_lib.json @@ -5,6 +5,10 @@ "configuration": { "help": "Build time configuration. Refer to Handbook for valid values. Default: full stack", "value": "nanostack_full" + }, + "trace_max_level": { + "help": "One of mbed-trace level defines: TRACE_LEVEL_DEBUG, TRACE_LEVEL_INFO, TRACE_LEVEL_WARN or TRACE_LEVEL_ERROR", + "value": null } }, "macros": ["NS_USE_EXTERNAL_MBED_TLS"], diff --git a/source/nsconfig.h b/source/nsconfig.h index dff8a5622d48..dfb182a5affb 100644 --- a/source/nsconfig.h +++ b/source/nsconfig.h @@ -54,6 +54,13 @@ #endif #endif /* HAVE_WS */ +/* Configure trace level for Nanostack */ +#ifdef MBED_CONF_NANOSTACK_TRACE_MAX_LEVEL +#ifdef MBED_TRACE_MAX_LEVEL +#undef MBED_TRACE_MAX_LEVEL +#endif /* MBED_TRACE_MAX_LEVEL */ +#define MBED_TRACE_MAX_LEVEL MBED_CONF_NANOSTACK_TRACE_MAX_LEVEL +#endif /* MBED_CONF_NANOSTACK_TRACE_MAX_LEVEL */ #endif // ifndef _NANOSTACK_SOURCE_CONFIG_H