Extend the logging module to support the common main + platform-specific hooks

This commit is contained in:
George Oikonomou 2017-10-18 00:16:11 +01:00 committed by George Oikonomou
parent 7b3f77ac2e
commit e9509be98c
3 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,10 @@
#define LOG_CONF_LEVEL_6TOP LOG_LEVEL_NONE
#endif /* LOG_CONF_LEVEL_6TOP */
#ifndef LOG_CONF_LEVEL_MAIN
#define LOG_CONF_LEVEL_MAIN LOG_LEVEL_INFO
#endif /* LOG_CONF_LEVEL_MAIN */
#endif /* __LOG_CONF_H__ */
/** @} */

View File

@ -59,6 +59,7 @@ int curr_log_level_nullnet = LOG_CONF_LEVEL_NULLNET;
int curr_log_level_mac = LOG_CONF_LEVEL_MAC;
int curr_log_level_framer = LOG_CONF_LEVEL_FRAMER;
int curr_log_level_6top = LOG_CONF_LEVEL_6TOP;
int curr_log_level_main = LOG_CONF_LEVEL_MAIN;
struct log_module all_modules[] = {
{"rpl", &curr_log_level_rpl, LOG_CONF_LEVEL_RPL},
@ -69,6 +70,7 @@ struct log_module all_modules[] = {
{"mac", &curr_log_level_mac, LOG_CONF_LEVEL_MAC},
{"framer", &curr_log_level_framer, LOG_CONF_LEVEL_FRAMER},
{"6top", &curr_log_level_6top, LOG_CONF_LEVEL_6TOP},
{"main", &curr_log_level_main, LOG_CONF_LEVEL_MAIN},
{NULL, NULL, 0},
};

View File

@ -81,6 +81,7 @@ extern int curr_log_level_nullnet;
extern int curr_log_level_mac;
extern int curr_log_level_framer;
extern int curr_log_level_6top;
extern int curr_log_level_main;
extern struct log_module all_modules[];
@ -92,6 +93,7 @@ extern struct log_module all_modules[];
#define LOG_LEVEL_MAC MIN((LOG_CONF_LEVEL_MAC), curr_log_level_mac)
#define LOG_LEVEL_FRAMER MIN((LOG_CONF_LEVEL_FRAMER), curr_log_level_framer)
#define LOG_LEVEL_6TOP MIN((LOG_CONF_LEVEL_6TOP), curr_log_level_6top)
#define LOG_LEVEL_MAIN MIN((LOG_CONF_LEVEL_MAIN), curr_log_level_main)
/* Main log function */