Skip to content

proposal: os/exec: add GODEBUG flag to print a line to STDERR for each command started #56301

@mknyszek

Description

@mknyszek

This came out of a conversation with @aclements about trying to understand what commands cmd/dist runs, but I've found such a thing to be useful for x/benchmarks/sweet as well (and had to implement my own wrapper to get this functionality).

These use-cases suggest this might be a more generally useful flag for debugging CLI tools that frequently start commands, especially when the logic for how those commands are constructed is somewhat complex.

The alternative is to use something like strace or whatever your platform provides, but this typically introduces additional overheads and it's a bit more indirect (i.e. syscall.Exec and os/exec.Command typically have different intents).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions