chezmoilog

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 5 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 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