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)
| 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. |
| 75 | func 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. |