logging: log_output: Improve immediate mode handling

When in immediate mode ensure that buffering is not used in log output.
Every byte is pushed to the transport.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2019-11-20 14:28:06 +01:00 committed by Andrew Boie
commit 117fab3004
4 changed files with 54 additions and 26 deletions

View file

@ -9,6 +9,7 @@
#include <logging/log_msg.h>
#include <sys/util.h>
#include <stdarg.h>
#include <sys/atomic.h>
#ifdef __cplusplus
extern "C" {
@ -66,7 +67,7 @@ typedef int (*log_output_func_t)(u8_t *buf, size_t size, void *ctx);
/* @brief Control block structure for log_output instance. */
struct log_output_control_block {
size_t offset;
atomic_t offset;
void *ctx;
const char *hostname;
};