Documentation ¶
Index ¶
- func NewZapLogger(logger *uzap.SugaredLogger) logger.Logger
- func NewZapLoggerWithConfig(config logger.Configuration) logger.Logger
- type ZapLogger
- func (l *ZapLogger) Debugf(format string, args ...interface{})
- func (l *ZapLogger) Errorf(format string, args ...interface{})
- func (l *ZapLogger) Fatalf(format string, args ...interface{})
- func (l *ZapLogger) Infof(format string, args ...interface{})
- func (l *ZapLogger) Panicf(format string, args ...interface{})
- func (l *ZapLogger) Warnf(format string, args ...interface{})
- func (l *ZapLogger) WithFields(fields logger.Fields) logger.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewZapLogger ¶
func NewZapLogger(logger *uzap.SugaredLogger) logger.Logger
NewZapLogger adapts existing sugared zap logger to Logger interface. The call is responsible for configuring sugard zap logger appropriately.
Note: Sugar wraps the Logger to provide a more ergonomic, but slightly slower, API. Sugaring a Logger is quite inexpensive, so it's reasonable for a single application to use both Loggers and SugaredLoggers, converting between them on the boundaries of performance-sensitive code.
Base zap logger can be convert to SugaredLogger by calling to add a wrapper: sugaredLogger := log.Sugar()
func NewZapLoggerWithConfig ¶
func NewZapLoggerWithConfig(config logger.Configuration) logger.Logger
NewZapLoggerWithConfig creates and configs Logger instance backed by zap Sugared logger.
Types ¶
Click to show internal directories.
Click to hide internal directories.