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

Method Sync

zapio/writer.go:128–134  ·  view source on GitHub ↗

Sync flushes buffered data to the logger as a new log entry even if it doesn't contain a newline.

()

Source from the content-addressed store, hash-verified

126// Sync flushes buffered data to the logger as a new log entry even if it
127// doesn't contain a newline.
128func (w *Writer) Sync() error {
129 // Don't allow empty messages on explicit Sync calls or on Close
130 // because we don't want an extraneous empty message at the end of the
131 // stream -- it's common for files to end with a newline.
132 w.flush(false /* allowEmpty */)
133 return nil
134}
135
136// flush flushes the buffered data to the logger, allowing empty messages only
137// if the bool is set.

Callers 2

TestWrite_SyncFunction · 0.95
CloseMethod · 0.95

Calls 1

flushMethod · 0.95

Tested by 1

TestWrite_SyncFunction · 0.76