Skip to content

Add debug output option #475

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

Open
jmpolom opened this issue Apr 17, 2024 · 7 comments · May be fixed by #1154
Open

Add debug output option #475

jmpolom opened this issue Apr 17, 2024 · 7 comments · May be fixed by #1154
Labels
area/client Related to the client/CLI enhancement New feature or request good first issue Good for newcomers

Comments

@jmpolom
Copy link

jmpolom commented Apr 17, 2024

When bootc shells out to external applications, such as during installation to sgdisk and systemd-cryptenroll, it should provide a way for the entire exact command to be logged or otherwise visible to the user for debugging purposes.

@jeckersb
Copy link
Collaborator

From:
https://github.com/containers/bootc/blob/9a1e29cf3f0d2aa45206845a7e69bb9f21a4a157/lib/src/task.rs#L89

Currently setting the environment RUST_LOG=debug should provide this with output like:

DEBUG exec: "ostree" "--repo=/ostree/repo" "rev-parse" "--single"

Is that sufficient? If so, at the very least it sounds like we could probably improve the docs to point this out.

@jmpolom
Copy link
Author

jmpolom commented Apr 17, 2024

I will try it and let you know what I find. It appears to do some kind of logging.

At a minimum a documentation improvement is needed to ensure that option is publicized, both on the website docs and in the help output from the (sub)command.

A flag would be far more user friendly than setting a random env var, particularly when dealing with the command running inside of a container. When running the command inside of the container you'd need to add an env var flag to the already very complex podman run invocation which will be tedious.

tldr; Adding a --verbose or --debug flag would be more user friendly/accessible than an env var.

@cgwalters cgwalters added enhancement New feature or request good first issue Good for newcomers area/client Related to the client/CLI labels Apr 22, 2024
cgwalters pushed a commit to cgwalters/bootc that referenced this issue Nov 5, 2024
….0.163

build(deps): bump serde from 1.0.162 to 1.0.163
cgwalters pushed a commit to cgwalters/bootc that referenced this issue Nov 6, 2024
@mabulgu
Copy link

mabulgu commented Feb 19, 2025

Hi @cgwalters & @jmarrero! Can I take this issue if nobody else is working on it? (no assignees but asking anyways) Not an expert on the topic but I want to give it a start on contributing to bootc so this issue looked suitable as this is a good first issue.

@mabulgu
Copy link

mabulgu commented Feb 20, 2025

/assign

Starting to look at this (in my spare time. So dont expect a quick PR pls). Pls let me know if you have any concerns.

Edit: Oh, seems that you don't have the assign bot.

@mabulgu
Copy link

mabulgu commented Feb 22, 2025

Image

This is how it looks like RN. I am going to create a PR soon. Before, I need to add some tests where possible.

@jmpolom
Copy link
Author

jmpolom commented Feb 23, 2025

Does this more or less follow the same code path as the previous env var method? Output looks quite similar.

@mabulgu
Copy link

mabulgu commented Feb 23, 2025

Does this more or less follow the same code path as the previous env var method? Output looks quite similar.

It is actually not related to the prev. code path. The tracing is the same tracing mechanism, we tweak it and add a new flag to the CLI for tweaking the log level on the fly. Now it is the --verbose flag does the magic. If someone uses the env var, this will be overriding, otherwise, the tracing level can be changed by using -v, -vv, -vvv:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client Related to the client/CLI enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants