log

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

func Debugf

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

func Error

func Error(msg string)

func Errorf

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

func Info

func Info(msg string)

func Infof

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

func SetLogger

func SetLogger(l LoggerInterface)

SetLogger changes the global logger to the one provided.

Types

type Fields

type Fields map[string]interface{}

Fields type, used to pass to `WithFields`.

type LoggerInterface

type LoggerInterface interface {
	Errorf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	Error(msg string)
	Info(msg string)
	Debug(msg string)
	WithFields(fields Fields) LoggerInterface
	WithError(err error) LoggerInterface
}

LoggerInterface is the interface used to abstract logging.

func NewLogrusWrapper

func NewLogrusWrapper(l *logrus.Logger) LoggerInterface

func NewZapWrapper added in v0.1.8

func NewZapWrapper(l *zap.Logger) LoggerInterface

func WithError

func WithError(err error) LoggerInterface

func WithFields

func WithFields(fields Fields) LoggerInterface

Jump to

Keyboard shortcuts

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