Skip to content

Conversation

Shawn-Huang724
Copy link

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.

Copy link

Hello @Shawn-Huang724, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@Shawn-Huang724
Copy link
Author

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.

@@ -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
Copy link
Contributor

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)) {

Copy link
Author

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.

@Shawn-Huang724 Shawn-Huang724 force-pushed the simplify-uart-log branch 2 times, most recently from 8624042 to 9f266c0 Compare August 22, 2025 05:28
nordic-krch
nordic-krch previously approved these changes Aug 22, 2025
Copy link
Contributor

@kartben kartben left a 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

@Shawn-Huang724
Copy link
Author

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.

@zephyrbot zephyrbot added the Release Notes To be mentioned in the release notes label Aug 22, 2025
@zephyrbot zephyrbot requested review from cfriedt and jhedberg August 22, 2025 10:21
@Shawn-Huang724
Copy link
Author

Please add the new Kconfig options to 4.3 release notes

Sure, commit is updated as d3f4b4d. Thanks.

bool "Timestamps in the backend"
default y
help
When enabled selected backend prints timestamps with log.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When enabled selected backend prints timestamps with log.
When enabled, selected backend prints timestamps with log.

bool "Levels in the backend"
default y
help
When enabled selected backend prints levels with log.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When enabled selected backend prints levels with log.
When enabled, selected backend prints levels with log.

Copy link
Author

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]>
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Logging Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants