zap

package
v0.0.0-...-0412f51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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

type ZapLogger

type ZapLogger struct {
	// contains filtered or unexported fields
}

func (*ZapLogger) Debugf

func (l *ZapLogger) Debugf(format string, args ...interface{})

func (*ZapLogger) Errorf

func (l *ZapLogger) Errorf(format string, args ...interface{})

func (*ZapLogger) Fatalf

func (l *ZapLogger) Fatalf(format string, args ...interface{})

func (*ZapLogger) Infof

func (l *ZapLogger) Infof(format string, args ...interface{})

func (*ZapLogger) Panicf

func (l *ZapLogger) Panicf(format string, args ...interface{})

func (*ZapLogger) Warnf

func (l *ZapLogger) Warnf(format string, args ...interface{})

func (*ZapLogger) WithFields

func (l *ZapLogger) WithFields(fields logger.Fields) logger.Logger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL