log

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug logs an debug message with the parameters

func Debugf

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

Debugf logs a formatted debug message

func Error

func Error(args ...interface{})

Error logs an error message with the parameters

func Errorf

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

Errorf logs a formatted error message

func Info

func Info(args ...interface{})

Info logs an info message with the parameters

func Infof

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

Infof logs a formatted info message

func SetLogger

func SetLogger(logger Logger)

SetLogger sets the default logger to be used by this package

Types

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(template string, args ...interface{})
	Info(args ...interface{})
	Infof(template string, args ...interface{})
	Error(args ...interface{})
	Errorf(template string, args ...interface{})
}

Logger is basic interface for integrating custom logger

type ZapLogger

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

ZapLogger object using simple SugaredLogger

func NewZapLogger

func NewZapLogger(debug bool) (*ZapLogger, error)

NewZapLogger creates a zap production or development logger based on debug argument

func NewZapLoggerFromSugar

func NewZapLoggerFromSugar(sl zap.SugaredLogger) *ZapLogger

NewZapLoggerFromSugar creates a ZapLogger from a zap.SugaredLogger

func (ZapLogger) Debug

func (z ZapLogger) Debug(args ...interface{})

Debug uses zap to log a debug message.

func (ZapLogger) Debugf

func (z ZapLogger) Debugf(template string, args ...interface{})

Debugf uses zap to log a debug message.

func (ZapLogger) Error

func (z ZapLogger) Error(args ...interface{})

Error uses zap to log a error message.

func (ZapLogger) Errorf

func (z ZapLogger) Errorf(template string, args ...interface{})

Errorf uses zap to log a error message.

func (ZapLogger) Fatal

func (z ZapLogger) Fatal(args ...interface{})

Fatal uses zap to log a fatal message.

func (ZapLogger) Fatalf

func (z ZapLogger) Fatalf(template string, args ...interface{})

Fatalf uses zap to log a fatal message.

func (ZapLogger) Info

func (z ZapLogger) Info(args ...interface{})

Info uses zap to log a info message.

func (ZapLogger) Infof

func (z ZapLogger) Infof(template string, args ...interface{})

Infof uses zap to log a info message.

func (ZapLogger) Panic

func (z ZapLogger) Panic(args ...interface{})

Panic uses zap to log a panic message.

func (ZapLogger) Panicf

func (z ZapLogger) Panicf(template string, args ...interface{})

Panicf uses zap to log a panic message.

func (ZapLogger) Sugar

func (z ZapLogger) Sugar() *zap.SugaredLogger

Sugar returns the underlying sugared zap logger that ZapLogger uses

func (ZapLogger) Warn

func (z ZapLogger) Warn(args ...interface{})

Warn uses zap to log a warning message.

func (ZapLogger) Warnf

func (z ZapLogger) Warnf(template string, args ...interface{})

Warnf uses zap to log a warning message.

Jump to

Keyboard shortcuts

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