Documentation ¶
Overview ¶
Package chezmoilog contains support for chezmoi logging.
Index ¶
- func FirstFewBytes(data []byte) []byte
- func LogCmdCombinedOutput(cmd *exec.Cmd) ([]byte, error)
- func LogCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func LogCmdRun(cmd *exec.Cmd) error
- func LogCmdStart(cmd *exec.Cmd) error
- func LogCmdWait(cmd *exec.Cmd) error
- func LogHTTPRequest(logger *zerolog.Logger, client *http.Client, req *http.Request) (*http.Response, error)
- func Output(data []byte, err error) []byte
- type OSExecCmdLogObject
- type OSExecExitErrorLogObject
- type OSProcessStateLogObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstFewBytes ¶
FirstFewBytes returns the first few bytes of data in a human-readable form.
func LogCmdCombinedOutput ¶
LogCmdCombinedOutput calls cmd.CombinedOutput, logs the result, and returns the result.
func LogCmdOutput ¶
LogCmdOutput calls cmd.Output, logs the result, and returns the result.
func LogCmdStart ¶ added in v2.40.0
LogCmdStart calls cmd.Start, logs the result, and returns the result.
func LogCmdWait ¶ added in v2.40.0
LogCmdWait calls cmd.Wait, logs the result, and returns the result.
Types ¶
type OSExecCmdLogObject ¶
An OSExecCmdLogObject wraps an *os/exec.Cmd and adds github.com/rs/zerolog.LogObjectMarshaler functionality.
func (OSExecCmdLogObject) MarshalZerologObject ¶
func (cmd OSExecCmdLogObject) MarshalZerologObject(event *zerolog.Event)
MarshalZerologObject implements github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject.
type OSExecExitErrorLogObject ¶
type OSExecExitErrorLogObject struct {
Err error
}
An OSExecExitErrorLogObject wraps an error and adds github.com/rs/zerolog.LogObjectMarshaler functionality if the wrapped error is an os/exec.ExitError.
func (OSExecExitErrorLogObject) MarshalZerologObject ¶
func (err OSExecExitErrorLogObject) MarshalZerologObject(event *zerolog.Event)
MarshalZerologObject implements github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject.
type OSProcessStateLogObject ¶
type OSProcessStateLogObject struct {
*os.ProcessState
}
An OSProcessStateLogObject wraps an *os.ProcessState and adds github.com/rs/zerolog.LogObjectMarshaler functionality.
func (OSProcessStateLogObject) MarshalZerologObject ¶
func (p OSProcessStateLogObject) MarshalZerologObject(event *zerolog.Event)
MarshalZerologObject implements github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject.