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

Function ErrorOutput

options.go:75–79  ·  view source on GitHub ↗

ErrorOutput sets the destination for errors generated by the Logger. Note that this option only affects internal errors; for sample code that sends error-level logs to a different location from info- and debug-level logs, see the package-level AdvancedConfiguration example. The supplied WriteSyncer

(w zapcore.WriteSyncer)

Source from the content-addressed store, hash-verified

73// The supplied WriteSyncer must be safe for concurrent use. The Open and
74// zapcore.Lock functions are the simplest ways to protect files with a mutex.
75func ErrorOutput(w zapcore.WriteSyncer) Option {
76 return optionFunc(func(log *Logger) {
77 log.errorOutput = w
78 })
79}
80
81// Development puts the logger in development mode, which makes DPanic-level
82// logs panic instead of simply logging an error.

Callers 7

NewLoggerFunction · 0.92
TestIncreaseLevelFunction · 0.85
TestSugarAddCallerFailFunction · 0.85
TestLoggerWriteFailureFunction · 0.85
TestLoggerAddCallerFailFunction · 0.85
buildOptionsMethod · 0.85

Calls 1

optionFuncFuncType · 0.70

Tested by 5

TestIncreaseLevelFunction · 0.68
TestSugarAddCallerFailFunction · 0.68
TestLoggerWriteFailureFunction · 0.68
TestLoggerAddCallerFailFunction · 0.68