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
| 49 | // |
| 50 | // Writer must be closed when finished to flush buffered data to the logger. |
| 51 | type 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 | |
| 65 | var ( |
| 66 | _ zapcore.WriteSyncer = (*Writer)(nil) |
nothing calls this directly
no outgoing calls
no test coverage detected