Repository navigation
commands: add debug as persistent flag - #2660
Conversation
Allows using `--debug` to enable debug logging under any subcommand. Currently it needed to be set as `docker --debug buildx` meaning only way to enable debug in standalone mode was to set env variable instead and updating existing commands to add `--debug` was cumbersome. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
| | [`--builder`](#builder) | `string` | | Override the configured builder instance | | ||
| | [`--call`](#call) | `string` | `build` | Set method for evaluating build (`check`, `outline`, `targets`) | | ||
| | [`--check`](#check) | `bool` | | Shorthand for `--call=check` | | ||
| | `-D`, `--debug` | `bool` | | Enable debug logging | |
There was a problem hiding this comment.
Do we want both the -D and the --debug to be inherited, or should we limit to only the long form (--debug) for now? (can we?)
cc @jalonsogo
There was a problem hiding this comment.
I think it should be invisible to user if this flag is defined in the cli or buildx binary. docker --debug buildx still uses the defined in CLI.
There was a problem hiding this comment.
Mostly looking here that the -D is documented for the top-level, but for the subcommands it's a new flag, and in most (if not all) cases we refer to it as --debug.
Where possibly I try to avoid shorthand flags if they're not critical to have (it's easy to add them later if there's a strong need), more so if they're case-sensitive (if there's both a -d and -D flag, which can be confusing).
There was a problem hiding this comment.
but for the subcommands it's a new flag, and in most (if not all) cases we refer to it as --debug.
--debug is also a new flag for subcommand.
I don't think any user would understand why one flag formatting works in one place but not another.
crazy-max
left a comment
There was a problem hiding this comment.
Could we have an integration test for checks with debug?
Allows using
--debugto enable debug logging under any subcommand. Currently it needed to be set asdocker --debug buildxmeaning only way to enable debug in standalone mode was to set env variable instead and updating existing commands to add--debugwas cumbersome.