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

Function NewTestingWriter

zaptest/logger.go:127–129  ·  view source on GitHub ↗

NewTestingWriter builds a new TestingWriter that writes to the given testing.TB. Use this if you need more flexibility when creating *zap.Logger than zaptest.NewLogger() provides. E.g., if you want to use custom core with zaptest.TestingWriter: encoder := newCustomEncoder() writer := zaptest.Ne

(t TestingT)

Source from the content-addressed store, hash-verified

125//
126// logger := zap.New(core, zap.AddCaller())
127func NewTestingWriter(t TestingT) TestingWriter {
128 return TestingWriter{t: t}
129}
130
131// WithMarkFailed returns a copy of this TestingWriter with markFailed set to
132// the provided value.

Callers 2

TestTestingWriterFunction · 0.85
NewLoggerFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestTestingWriterFunction · 0.68