Documentation ¶
Index ¶
- func Console()
- func CopyContext(ctx context.Context, dst context.Context) context.Context
- func Exec(ctx context.Context, cmd *exec.Cmd, options ...ExecOption) error
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Logger(ctx context.Context) *zap.Logger
- func Panic(v ...interface{})
- func Panicf(msg string, v ...interface{})
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func Structured()
- func With(ctx context.Context, key string, value interface{}) context.Context
- func WithFields(ctx context.Context, fields ...zapcore.Field) context.Context
- type ExecOption
- type Filter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyContext ¶
CopyContext returns a context derived from dst that contains the eventual logging keys that are contained in ctx
func Exec ¶
Exec wraps os/exec for logging its outputs. If cmd.Stdout is not set, the commands stdout will be sent to log.Logger(ctx) (at Info level by default). If cmd.Stderr is not set, the commands stderr will be sent to log.Logger(ctx) (at Warn level by default). On ctx cancellation, the cmd is Killed
Types ¶
type ExecOption ¶
type ExecOption func(eo *execOption)
ExecOption is an option that can be passed to Exec()
func StderrFilter ¶
func StderrFilter(f Filter) ExecOption
StderrFilter sets a function that modify a stderr message or change its level
func StderrLevel ¶
func StderrLevel(l zapcore.Level) ExecOption
StderrLevel sets the level at which stderr should be logged
func StdoutFilter ¶
func StdoutFilter(f Filter) ExecOption
StdoutFilter sets a function that modify a stdout message or change its level
func StdoutLevel ¶
func StdoutLevel(l zapcore.Level) ExecOption
StdoutLevel sets the level at which stdout should be logged