Add debug output option
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.
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.
~~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.
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.
/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.
This is how it looks like RN. I am going to create a PR soon. Before, I need to add some tests where possible.
Does this more or less follow the same code path as the previous env var method? Output looks quite similar.
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: