Skip to content

Commit

Permalink
sys/log: Add default log names
Browse files Browse the repository at this point in the history
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 <jerzy.kasenberg@codecoup.pl>
  • Loading branch information
kasjer committed Sep 2, 2024
1 parent 1868e19 commit 247668b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sys/log/full/src/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 247668b

Please sign in to comment.