MCPcopy
hub / github.com/uber-go/zap / Writer

Struct Writer

zapio/writer.go:51–63  ·  view source on GitHub ↗

Writer is an io.Writer that writes to the provided Zap logger, splitting log messages on line boundaries. The Writer will buffer writes in memory until it encounters a newline, or the caller calls Sync or Close. Use the Writer with packages like os/exec where an io.Writer is required, and you want

Source from the content-addressed store, hash-verified

49//
50// Writer must be closed when finished to flush buffered data to the logger.
51type Writer struct {
52 // Log specifies the logger to which the Writer will write messages.
53 //
54 // The Writer will panic if Log is unspecified.
55 Log *zap.Logger
56
57 // Log level for the messages written to the provided logger.
58 //
59 // If unspecified, defaults to Info.
60 Level zapcore.Level
61
62 buff bytes.Buffer
63}
64
65var (
66 _ zapcore.WriteSyncer = (*Writer)(nil)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected