-
Notifications
You must be signed in to change notification settings - Fork 7.9k
logging: allow simplified logging of UART backend #94534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
logging: allow simplified logging of UART backend #94534
Conversation
Hello @Shawn-Huang724, and thank you very much for your first pull request to the Zephyr project! |
On our platform, the logging will be switched from UART to another backend when the remote side is ready. That's why we need a simple and quick output text format in UART backend. Any advice would be appreciated, thank you. |
subsys/logging/backends/Kconfig.uart
Outdated
@@ -36,6 +36,13 @@ config LOG_BACKEND_UART_AUTOSTART | |||
application start. When disabled, the application needs to start | |||
the backend manually using log_backend_enable(). | |||
|
|||
config LOG_BACKEND_UART_OUTPUT_MINIMAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about instead of adding uart specific option extend to skip level and timestamp for all backends?
There is already option to not use colors (but level and timestamp is already added).
if (IS_ENABLED(CONFIG_LOG_BACKEND_SHOW_COLOR)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree to extend this option to each backend. Thanks for your thoughtful suggestion and commit is updated.
8624042
to
9f266c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the new Kconfig options to 4.3 release notes
9f266c0
to
a2b3f98
Compare
Sorry, fix some log tests failed in a2b3f98. Since log_backend_std_get_flags() always returns flags with timestamp and level enabled before this PL, these two new added options should be also default enabled for all cases. |
1db3bbd
to
d3f4b4d
Compare
Sure, commit is updated as d3f4b4d. Thanks. |
subsys/logging/Kconfig.formatting
Outdated
bool "Timestamps in the backend" | ||
default y | ||
help | ||
When enabled selected backend prints timestamps with log. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When enabled selected backend prints timestamps with log. | |
When enabled, selected backend prints timestamps with log. |
subsys/logging/Kconfig.formatting
Outdated
bool "Levels in the backend" | ||
default y | ||
help | ||
When enabled selected backend prints levels with log. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When enabled selected backend prints levels with log. | |
When enabled, selected backend prints levels with log. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your careful reviewing, commits were updated as 1d9a7ae.
This allows no timestamps and level prefixes in backend log output. Signed-off-by: Shawn Huang <[email protected]>
LOG_BACKEND_SHOW_TIMESTAMP and LOG_BACKEND_SHOW_LEVEL Signed-off-by: Shawn Huang <[email protected]>
d3f4b4d
to
1d9a7ae
Compare
|
This allows no timestamps, level prefixes, and colors in UART backend logging. The message format will be similar as the ones with CONFIG_LOG_MODE_MINIMAL=y. It also could reduce the output overhead of UART interface when logging backend is enabled.