package zaplog

Import Path
	go.pact.im/x/zaplog (on go.dev)

Dependency Relation
	imports 3 packages, and imported by 0 packages

Involved Source Files Package zaplog provides a constructor for zap.Logger with sensible defaults.
Code Examples package main import ( "go.pact.im/x/zaplog" "go.uber.org/zap" "go.uber.org/zap/zapcore" "io" "os" ) func main() { lg := zaplog.Tee(zaplog.New(io.Discard).With( // Note that Tee does carry existing context to the target // core since it’s attached to the current core only. zap.String("ignored", "oops"), ), zapcore.NewCore( zapcore.NewConsoleEncoder(zapcore.EncoderConfig{ MessageKey: "msg", LevelKey: "level", EncodeLevel: zapcore.LowercaseLevelEncoder, ConsoleSeparator: ": ", }), zapcore.AddSync(os.Stdout), zap.DebugLevel, )).With(zap.String("shark", "gawr gura")) lg.Debug("cheeki breeki") }
Package-Level Functions (total 2, both are exported)
New returns a new zap.Logger that writes to w.
Tee returns log’s clone that duplicates log entries into another core.