logging: Add buffer flushing on entering panic

It may happen that panic occured while logger backend
was formatting output data. In that case output buffer
could get corrupted as logger assumes that processing
happens in one context only (panic is the only exception).

Added log output buffer flushing on entering panic state.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2019-01-04 08:52:45 +01:00 committed by Anas Nashif
commit 4e32721135
3 changed files with 3 additions and 1 deletions

View file

@ -232,6 +232,7 @@ static void log_backend_rtt_init(void)
static void panic(struct log_backend const *const backend)
{
log_output_flush(&log_output);
panic_mode = 1;
}