Skip to content

Conversation

@cgwalters
Copy link
Collaborator

Otherwise we just completely break machine readability with bootc status --format=json.

(We probably need a full audit to stop using {,e}println!
globally)

Otherwise we just completely break machine readability
with `bootc status --format=json`.

(We probably need a full audit to stop using `{,e}println!`
 globally)

Signed-off-by: Colin Walters <[email protected]>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly changes the logging of the sysroot lock wait message from stdout to stderr. This is an important fix to prevent breaking machine-readable output formats like JSON. My review includes a suggestion to use a proper logging framework for better maintainability and to update the related documentation to reflect this change.

}
if !printed {
println!("Waiting for sysroot lock...");
eprintln!("Waiting for sysroot lock...");
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While using eprintln! is a good step to avoid polluting stdout, it would be more idiomatic and maintainable to use a structured logging facade like the log crate (e.g., log::info!("Waiting for sysroot lock...")). This aligns with the goal of auditing println! usage mentioned in the PR description and allows for benefits like configurable log levels.

As a side note, the doc comment for new_from_sysroot on line 35 is now outdated and should be updated to state that the message is printed to standard error.

@ckyrouac ckyrouac enabled auto-merge (rebase) August 20, 2025 14:13
@ckyrouac ckyrouac merged commit 7a82af6 into bootc-dev:main Aug 20, 2025
21 of 28 checks passed
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