Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/api/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ extern int *Platform_get_logging_module_level(const char *const module_name, con
# define MAX_LOG_LEVEL ERROR_LOG_LEVEL
#endif

#if !defined(INCLUDE_LOG)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of the flag?
Just a shortcut instead of defininig MAX_LOG_LEVEL to NO_LOG_LEVEL directly ?
CFLAGS += -DMAX_LOG_LEVEL =-1 wouldn't work directly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAX_LOG_LEVEL is set by each file before including logger.h.
If I understand your proposal, MAX_LOG_LEVEL defined with cflags will be redefined, so it will not work, no ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I missed this point!

# define INCLUDE_LOG 1
#endif

#if (!INCLUDE_LOG)
#undef MAX_LOG_LEVEL
#define MAX_LOG_LEVEL NO_LOG_LEVEL
#endif

#ifndef LOG_MODULE_NAME
/* Name of the module */
# error "No module name set for logger"
Expand Down
Loading