Skip to content

Commit

Permalink
logging: make CONFIG_LOG_ALWAYS_RUNTIME build check less ambiguous
Browse files Browse the repository at this point in the history
When these fails the compiler just prints "Option must be enabled" with
no reference to what option, so one has to look at the code to find out.
Mention the actual option in the error to make these unambiguous.

Signed-off-by: Fabio Baltieri <[email protected]>
  • Loading branch information
fabiobaltieri authored and carlescufi committed Jan 2, 2024
1 parent 5a727a3 commit a3e39cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions subsys/logging/log_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ LOG_MODULE_REGISTER(log);

#ifndef CONFIG_LOG_ALWAYS_RUNTIME
BUILD_ASSERT(!IS_ENABLED(CONFIG_NO_OPTIMIZATIONS),
"Option must be enabled when CONFIG_NO_OPTIMIZATIONS is set");
"CONFIG_LOG_ALWAYS_RUNTIME must be enabled when "
"CONFIG_NO_OPTIMIZATIONS is set");
BUILD_ASSERT(!IS_ENABLED(CONFIG_LOG_MODE_IMMEDIATE),
"Option must be enabled when CONFIG_LOG_MODE_IMMEDIATE is set");
"CONFIG_LOG_ALWAYS_RUNTIME must be enabled when "
"CONFIG_LOG_MODE_IMMEDIATE is set");
#endif

static const log_format_func_t format_table[] = {
Expand Down

0 comments on commit a3e39cb

Please sign in to comment.