Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
e3da-public
contiki-ng
Commits
521d5c5a
Commit
521d5c5a
authored
Oct 18, 2017
by
George Oikonomou
Browse files
Make logging module/level prefix optional
parent
882be254
Changes
2
Hide whitespace changes
Inline
Side-by-side
os/sys/log-conf.h
View file @
521d5c5a
...
...
@@ -60,6 +60,13 @@
#define LOG_WITH_LOC 0
#endif
/* LOG_CONF_WITH_LOC */
/* Prefix all logs with Module name and logging level */
#ifdef LOG_CONF_WITH_MODULE_PREFIX
#define LOG_WITH_MODULE_PREFIX LOG_CONF_WITH_MODULE_PREFIX
#else
/* LOG_CONF_WITH_MODULE_PREFIX */
#define LOG_WITH_MODULE_PREFIX 1
#endif
/* LOG_CONF_WITH_MODULE_PREFIX */
/* Cooja annotations */
#ifdef LOG_CONF_WITH_ANNOTATE
#define LOG_WITH_ANNOTATE LOG_CONF_WITH_ANNOTATE
...
...
os/sys/log.h
View file @
521d5c5a
...
...
@@ -98,7 +98,9 @@ extern struct log_module all_modules[];
#define LOG(newline, level, levelstr, ...) do { \
if(level <= (LOG_LEVEL)) { \
if(newline) { \
LOG_OUTPUT("[%-4s: %-10s] ", levelstr, LOG_MODULE); \
if(LOG_WITH_MODULE_PREFIX) { \
LOG_OUTPUT("[%-4s: %-10s] ", levelstr, LOG_MODULE); \
} \
if(LOG_WITH_LOC) { \
LOG_OUTPUT("[%s: %d] ", __FILE__, __LINE__); \
} \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment