Documentation ¶
Overview ¶
Package xexec helps creating exec.Cmd with logging and executing those commands without leaking orphan processes.
All functions return our standard xerror.Error in case of error.
Index ¶
- func Command(logger xlog.Logger, binary string, args ...string) (*exec.Cmd, error)
- func CommandContext(ctx context.Context, logger xlog.Logger, binary string, args ...string) (*exec.Cmd, error)
- func LogBeforeExecute(logger xlog.Logger, cmd *exec.Cmd)
- func Run(ctx context.Context, logger xlog.Logger, binary string, args ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command is a wrapper around exec.Command.
If given xlog.Logger has a xlog.DebugLevel, also logs the output from the command.
func CommandContext ¶
func CommandContext(ctx context.Context, logger xlog.Logger, binary string, args ...string) (*exec.Cmd, error)
CommandContext is a wrapper around exec.CommandContext.
If given xlog.Logger has a xlog.DebugLevel, also logs the output from the command.
func LogBeforeExecute ¶
LogBeforeExecute logs a command before its execution.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.