logging: Add prompt to LOG2_ALWAYS_RUNTIME option

Prompt was removed by 154ca8526 to ensure that it is not
disable when it is required. That removed possibility of
manually enabling that option my the user. Bringing prompt
back and adding check to code to fail compilation if
LOG2_ALWAYS_RUNTIME is not set but is required.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-03-07 11:31:25 +01:00 committed by Carles Cufí
commit 3cbfc505b3
2 changed files with 11 additions and 4 deletions

View file

@ -60,6 +60,13 @@ LOG_MODULE_REGISTER(log);
#define CONFIG_LOG_BUFFER_SIZE 4
#endif
#ifndef CONFIG_LOG2_ALWAYS_RUNTIME
BUILD_ASSERT(!IS_ENABLED(CONFIG_NO_OPTIMIZATIONS),
"Option 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");
#endif
#ifndef CONFIG_LOG1
static const log_format_func_t format_table[] = {
[LOG_OUTPUT_TEXT] = log_output_msg2_process,