chezmoilog

package
v2.44.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package chezmoilog contains support for chezmoi logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstFewBytes

func FirstFewBytes(data []byte) []byte

FirstFewBytes returns the first few bytes of data in a human-readable form.

func LogCmdCombinedOutput

func LogCmdCombinedOutput(cmd *exec.Cmd) ([]byte, error)

LogCmdCombinedOutput calls cmd.CombinedOutput, logs the result, and returns the result.

func LogCmdOutput

func LogCmdOutput(cmd *exec.Cmd) ([]byte, error)

LogCmdOutput calls cmd.Output, logs the result, and returns the result.

func LogCmdRun

func LogCmdRun(cmd *exec.Cmd) error

LogCmdRun calls cmd.Run, logs the result, and returns the result.

func LogCmdStart added in v2.40.0

func LogCmdStart(cmd *exec.Cmd) error

LogCmdStart calls cmd.Start, logs the result, and returns the result.

func LogCmdWait added in v2.40.0

func LogCmdWait(cmd *exec.Cmd) error

LogCmdWait calls cmd.Wait, logs the result, and returns the result.

func LogHTTPRequest added in v2.9.3

func LogHTTPRequest(logger *zerolog.Logger, client *http.Client, req *http.Request) (*http.Response, error)

LogHTTPRequest calls httpClient.Do, logs the result to logger, and returns the result.

func Output added in v2.5.1

func Output(data []byte, err error) []byte

Output returns the first few bytes of output if err is nil, otherwise it returns the full output.

Types

type OSExecCmdLogObject

type OSExecCmdLogObject struct {
	*exec.Cmd
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL