From f332e04c9f3a024efc3ba67a3e3427e4678db2bd Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Mon, 12 Aug 2024 12:47:55 +0200 Subject: [PATCH] sys/log: Add default log names There are several predefined modules that have assigned module id but are not generated by newt tool This adds string values that are used to get modlog module name for those predefined modules. Signed-off-by: Jerzy Kasenberg --- sys/log/full/src/log.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/log/full/src/log.c b/sys/log/full/src/log.c index 68c04d6f00..4242e4c58e 100644 --- a/sys/log/full/src/log.c +++ b/sys/log/full/src/log.c @@ -226,12 +226,27 @@ log_module_register(uint8_t id, const char *name) return id; } +static const char *const default_modules[] = { + "DEFAULT", + "OS", + "NEWTMGR", + "NIMBLE_CTLR", + "NIMBLE_HOST", + "NFFS", + "REBOOT", + "IOTIVITY", +}; + const char * log_module_get_name(uint8_t module) { int idx; const char *name; + if (module < LOG_MODULE_TEST) { + return default_modules[module]; + } + /* Find module defined in syscfg.logcfg sections */ name = logcfg_log_module_name(module);