File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,11 @@ with function name. Hexdump messages are not prepended.
181
181
:kconfig:option: `CONFIG_LOG_FUNC_NAME_PREFIX_DBG `: Prepend standard DEBUG log messages
182
182
with function name. Hexdump messages are not prepended.
183
183
184
+ :kconfig:option: `CONFIG_LOG_BACKEND_SHOW_TIMESTAMP `: Enables backend to print timestamps
185
+ with log.
186
+
187
+ :kconfig:option: `CONFIG_LOG_BACKEND_SHOW_LEVEL `: Enables backend to print levels with log.
188
+
184
189
:kconfig:option: `CONFIG_LOG_BACKEND_SHOW_COLOR `: Enables coloring of errors (red)
185
190
and warnings (yellow).
186
191
Original file line number Diff line number Diff line change @@ -23,7 +23,15 @@ extern "C" {
23
23
24
24
static inline uint32_t log_backend_std_get_flags (void )
25
25
{
26
- uint32_t flags = (LOG_OUTPUT_FLAG_LEVEL | LOG_OUTPUT_FLAG_TIMESTAMP );
26
+ uint32_t flags = 0 ;
27
+
28
+ if (IS_ENABLED (CONFIG_LOG_BACKEND_SHOW_TIMESTAMP )) {
29
+ flags |= LOG_OUTPUT_FLAG_TIMESTAMP ;
30
+ }
31
+
32
+ if (IS_ENABLED (CONFIG_LOG_BACKEND_SHOW_LEVEL )) {
33
+ flags |= LOG_OUTPUT_FLAG_LEVEL ;
34
+ }
27
35
28
36
if (IS_ENABLED (CONFIG_LOG_BACKEND_SHOW_COLOR )) {
29
37
flags |= LOG_OUTPUT_FLAG_COLORS ;
Original file line number Diff line number Diff line change @@ -132,6 +132,18 @@ config LOG_IMMEDIATE_CLEAN_OUTPUT
132
132
this option is causing interrupts locking for significant amount of
133
133
time (up to multiple milliseconds).
134
134
135
+ config LOG_BACKEND_SHOW_TIMESTAMP
136
+ bool "Timestamps in the backend"
137
+ default y
138
+ help
139
+ When enabled, selected backend prints timestamps with log.
140
+
141
+ config LOG_BACKEND_SHOW_LEVEL
142
+ bool "Levels in the backend"
143
+ default y
144
+ help
145
+ When enabled, selected backend prints levels with log.
146
+
135
147
config LOG_BACKEND_SHOW_COLOR
136
148
bool "Colors in the backend"
137
149
default y if LOG_BACKEND_UART || LOG_BACKEND_NATIVE_POSIX || LOG_BACKEND_RTT \
@@ -172,7 +184,7 @@ config LOG_BACKEND_SUPPORTS_FORMAT_TIMESTAMP
172
184
config LOG_BACKEND_FORMAT_TIMESTAMP
173
185
bool "Timestamp formatting in the backend"
174
186
depends on LOG_BACKEND_SUPPORTS_FORMAT_TIMESTAMP
175
- default y
187
+ default y if LOG_BACKEND_SHOW_TIMESTAMP
176
188
help
177
189
When enabled timestamp is formatted.
178
190
You can’t perform that action at this time.
0 commit comments