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.
181181:kconfig:option: `CONFIG_LOG_FUNC_NAME_PREFIX_DBG `: Prepend standard DEBUG log messages
182182with function name. Hexdump messages are not prepended.
183183
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+
184189:kconfig:option: `CONFIG_LOG_BACKEND_SHOW_COLOR `: Enables coloring of errors (red)
185190and warnings (yellow).
186191
Original file line number Diff line number Diff line change @@ -23,7 +23,15 @@ extern "C" {
2323
2424static inline uint32_t log_backend_std_get_flags (void )
2525{
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+ }
2735
2836 if (IS_ENABLED (CONFIG_LOG_BACKEND_SHOW_COLOR )) {
2937 flags |= LOG_OUTPUT_FLAG_COLORS ;
Original file line number Diff line number Diff line change @@ -132,6 +132,18 @@ config LOG_IMMEDIATE_CLEAN_OUTPUT
132132 this option is causing interrupts locking for significant amount of
133133 time (up to multiple milliseconds).
134134
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+
135147config LOG_BACKEND_SHOW_COLOR
136148 bool "Colors in the backend"
137149 default y if LOG_BACKEND_UART || LOG_BACKEND_NATIVE_POSIX || LOG_BACKEND_RTT \
@@ -172,7 +184,7 @@ config LOG_BACKEND_SUPPORTS_FORMAT_TIMESTAMP
172184config LOG_BACKEND_FORMAT_TIMESTAMP
173185 bool "Timestamp formatting in the backend"
174186 depends on LOG_BACKEND_SUPPORTS_FORMAT_TIMESTAMP
175- default y
187+ default y if LOG_BACKEND_SHOW_TIMESTAMP
176188 help
177189 When enabled timestamp is formatted.
178190
You can’t perform that action at this time.
0 commit comments