logging: Add option to suppress level printing in log_output

Added flag in log_output module to add severity level when message is
formatted to a string. Updated existing backends.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2018-09-26 08:12:45 +02:00 committed by Carles Cufí
commit 07da32aae5
5 changed files with 21 additions and 14 deletions

View file

@ -74,16 +74,12 @@ void shell_log_backend_disable(const struct shell_log_backend *backend)
static void msg_process(const struct log_output *log_output,
struct log_msg *msg)
{
u32_t flags = 0;
u32_t flags = LOG_OUTPUT_FLAG_LEVEL | LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP;
if (IS_ENABLED(CONFIG_SHELL)) {
if (IS_ENABLED(CONFIG_SHELL_VT100_COLORS)) {
flags |= LOG_OUTPUT_FLAG_COLORS;
}
if (IS_ENABLED(CONFIG_SHELL)) {
flags |= LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP;
}
log_output_msg_process(log_output, msg, flags);
log_msg_put(msg);
}