Documentation ¶
Overview ¶
Provides a thread-safe, lock-free, non-blocking io.Writer wrapper.
Index ¶
- func Check(v *Logger) bool
- func ConfigDefaultLogger(lc *LoggerConfig)
- func Debug(msg string, fields ...zap.Field)
- func Debugf(template string, args ...interface{})
- func Error(msg string, fields ...zap.Field)
- func Errorf(template string, args ...interface{})
- func Exitf(template string, args ...interface{})
- func Fatal(msg string, fields ...zap.Field)
- func Fatalf(template string, args ...interface{})
- func FlushLogs()
- func Info(msg string, fields ...zap.Field)
- func Infof(template string, args ...interface{})
- func InitLogs()
- func InitSummaryLogs()
- func TimeTrack(start time.Time, name string)
- func Warn(msg string, fields ...zap.Field)
- func Warnf(template string, args ...interface{})
- type Alerter
- type DiodeWriter
- type Level
- type Logger
- func (l *Logger) AddCallerSkip(n int) *Logger
- func (l *Logger) Debug(msg string, fields ...zap.Field)
- func (l *Logger) Debugf(template string, args ...interface{})
- func (l *Logger) Error(msg string, fields ...zap.Field)
- func (l *Logger) Errorf(template string, args ...interface{})
- func (l *Logger) Fatalf(template string, args ...interface{})
- func (l *Logger) Info(msg string, fields ...zap.Field)
- func (l *Logger) Infof(template string, args ...interface{})
- func (l *Logger) TimeTrack(start time.Time, thumbnail string, fields ...zap.Field)
- func (l *Logger) V(level Level) *Logger
- func (l *Logger) Warn(msg string, fields ...zap.Field)
- func (l *Logger) Warnf(template string, args ...interface{})
- func (l *Logger) With(fields ...zap.Field) *Logger
- func (l *Logger) WithField(k, v string) *Logger
- func (l *Logger) WithStringField(k, v string) *Logger
- type LoggerConfig
- type Rotate
- type RotateOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigDefaultLogger ¶
func ConfigDefaultLogger(lc *LoggerConfig)
Types ¶
type DiodeWriter ¶
type DiodeWriter struct {
// contains filtered or unexported fields
}
DiodeWriter is a io.Writer wrapper that uses a diode to make Write lock-free, non-blocking and thread safe.
func NewDiodeWriter ¶
NewDiodeWriter creates a writer wrapping w with a many-to-one diode in order to never block log producers and drop events if the writer can't keep up with the flow of data.
Use a diode.Writer when
wr := diode.NewDiodeWriter(w, 1000, 10 * time.Millisecond, func(missed int) { log.Printf("Dropped %d messages", missed) }) log := zerolog.New(wr)
See code.cloudfoundry.org/go-diodes for more info on diode.
func (DiodeWriter) Close ¶
func (dw DiodeWriter) Close() error
Close releases the diode poller and call Close on the wrapped writer if io.Closer is implemented.
type Level ¶
type Level int32
Level specifies a level of verbosity for V logs. *Level implements flag.Value; the -v flag is of type Level and should be modified only through the flag.Value interface.
type Logger ¶
Logger xxx
func (*Logger) AddCallerSkip ¶
func (*Logger) Debug ¶
Debug is equivalent to the global Debug function, guarded by the value of v. See the documentation of V for usage.
func (*Logger) Debugf ¶
Debugf is equivalent to the global Debugf function, guarded by the value of v. See the documentation of V for usage.
func (*Logger) Info ¶
Info is equivalent to the global Info function, guarded by the value of v. See the documentation of V for usage.
func (*Logger) Infof ¶
Infof is equivalent to the global Infof function, guarded by the value of v. See the documentation of V for usage.
func (*Logger) Warn ¶
Warn is equivalent to the global Warn function, guarded by the value of v. See the documentation of V for usage.