Skip to content

logging cleanup#40

Merged
michaelolbrich merged 4 commits into
pengutronix:mainfrom
michaelolbrich:logging
Jun 17, 2026
Merged

logging cleanup#40
michaelolbrich merged 4 commits into
pengutronix:mainfrom
michaelolbrich:logging

Conversation

@michaelolbrich

Copy link
Copy Markdown
Member

Some minor logging improvements, including the refactoring mentioned here #38 (comment).

KarlK90
KarlK90 previously approved these changes Jun 16, 2026
Comment thread src/init.rs Outdated
It may be empty, so the message can be confusing without the quotes.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
With that, the messages are visible with the default
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Move activating the logger into the logger code.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>

@KarlK90 KarlK90 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One nit, otherwise LGTM.

Comment thread src/init.rs
Comment on lines +181 to +184
info!(
concat!(env!("CARGO_PKG_NAME"), " version {}"),
git_version!(fallback = env!("CARGO_PKG_VERSION"))
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
info!(
concat!(env!("CARGO_PKG_NAME"), " version {}"),
git_version!(fallback = env!("CARGO_PKG_VERSION"))
);
info!(
"{} version {}",
env!("CARGO_PKG_NAME"),
git_version!(fallback = env!("CARGO_PKG_VERSION"))
);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd rather not do that.

  1. It adds extra overhead at runtime instead of combining the string literals at compile time
  2. The concat makes it clearer which parts are evaluated at runtime and which at compile time

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alright, fine with me.

@michaelolbrich michaelolbrich merged commit 9fefa1f into pengutronix:main Jun 17, 2026
13 checks passed
@michaelolbrich michaelolbrich deleted the logging branch June 17, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants