Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
log_backend_std.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef ZEPHYR_LOG_BACKEND_STD_H_
7#define ZEPHYR_LOG_BACKEND_STD_H_
8
11#include <zephyr/kernel.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
23
30{
31 uint32_t flags = 0;
32
33 if (IS_ENABLED(CONFIG_LOG_BACKEND_SHOW_TIMESTAMP)) {
35 }
36
37 if (IS_ENABLED(CONFIG_LOG_BACKEND_SHOW_LEVEL)) {
39 }
40
41 if (IS_ENABLED(CONFIG_LOG_BACKEND_SHOW_COLOR)) {
43 }
44
45 if (IS_ENABLED(CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP)) {
47 }
48
49 if (IS_ENABLED(CONFIG_LOG_BACKEND_CRLF_NONE)) {
51 }
52
53 if (IS_ENABLED(CONFIG_LOG_BACKEND_CRLF_LFONLY)) {
55 }
56
57 if (IS_ENABLED(CONFIG_LOG_THREAD_ID_PREFIX)) {
59 }
60
61 if (IS_ENABLED(CONFIG_LOG_BACKEND_SKIP_SOURCE)) {
63 }
64
65 return flags;
66}
67
72static inline void
73log_backend_std_panic(const struct log_output *const output)
74{
75 log_output_flush(output);
76}
77
83static inline void
84log_backend_std_dropped(const struct log_output *const output, uint32_t cnt)
85{
86 log_output_dropped_process(output, cnt);
87}
88
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* ZEPHYR_LOG_BACKEND_STD_H_ */
#define LOG_OUTPUT_FLAG_THREAD
Flag thread id or name prefix.
Definition log_output.h:55
#define LOG_OUTPUT_FLAG_LEVEL
Flag forcing severity level prefix.
Definition log_output.h:42
#define LOG_OUTPUT_FLAG_CRLF_LFONLY
Flag forcing a single LF character for line breaks.
Definition log_output.h:48
#define LOG_OUTPUT_FLAG_SKIP_SOURCE
Flag forcing to skip logging the source.
Definition log_output.h:58
#define LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP
Flag forcing timestamp formatting.
Definition log_output.h:39
#define LOG_OUTPUT_FLAG_TIMESTAMP
Flag forcing timestamp.
Definition log_output.h:36
#define LOG_OUTPUT_FLAG_CRLF_NONE
Flag preventing the logger from adding CR and LF characters.
Definition log_output.h:45
#define LOG_OUTPUT_FLAG_COLORS
Flag forcing ANSI escape code colors, red (errors), yellow (warnings).
Definition log_output.h:33
static uint32_t log_backend_std_get_flags(void)
Retrieve the current flags of the standard logger backend interface.
Definition log_backend_std.h:29
static void log_backend_std_dropped(const struct log_output *const output, uint32_t cnt)
Report dropped messages to a standard logger backend.
Definition log_backend_std.h:84
static void log_backend_std_panic(const struct log_output *const output)
Put a standard logger backend into panic mode.
Definition log_backend_std.h:73
void log_output_dropped_process(const struct log_output *output, uint32_t cnt)
Process dropped messages indication.
static void log_output_flush(const struct log_output *output)
Flush output buffer.
Definition log_output.h:215
#define IS_ENABLED(config_macro)
Check for macro definition in compiler-visible expressions.
Definition util_macro.h:148
Public kernel APIs.
flags
Definition parser.h:97
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Log_output instance structure.
Definition log_output.h:96