logger

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 8 Imported by: 130

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFlags added in v1.4.0

func BindFlags(flags *pflag.FlagSet)

func Debugf

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

func Errorf

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

func Fatalf

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

func Infof

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

func IsDebugEnabled

func IsDebugEnabled() bool

func IsTraceEnabled

func IsTraceEnabled() bool

func ParseFlags added in v1.4.0

func ParseFlags(flags *pflag.FlagSet)

func Prettyf added in v1.3.0

func Prettyf(msg string, obj interface{})

Prettyf is like Tracef, but pretty prints the entire struct

func Secretf added in v1.3.0

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

Secretf is like Tracef, but attempts to strip any secrets from the text

func Tracef

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

func UseZap added in v1.4.0

func UseZap(flags *pflag.FlagSet)

func Warnf

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

Types

type Logger

type Logger interface {
	Warnf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	Tracef(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
	WithValues(keysAndValues ...interface{}) Logger
	IsTraceEnabled() bool
	IsDebugEnabled() bool
	SetLogLevel(level int)
	V(level int) Verbose
}

func NewLogrusLogger added in v1.4.1

func NewLogrusLogger(existing logrusapi.Ext1FieldLogger) Logger

func StandardLogger

func StandardLogger() Logger

func WithValues added in v1.4.2

func WithValues(keysAndValues ...interface{}) Logger

type Verbose added in v1.5.1

type Verbose interface {
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Infoln(args ...interface{})
}

func V added in v1.5.1

func V(level int) Verbose

type ZapLogger added in v1.4.0

type ZapLogger struct {
	Json            bool
	Level           *zapapi.AtomicLevel
	Base            *zapapi.Logger
	Logger          *zapapi.SugaredLogger
	LevelEncoder    zapcore.LevelEncoder
	TimeEncoder     zapcore.TimeEncoder
	StackTraceLevel *zap.AtomicLevel
}

func GetZapLogger added in v1.4.0

func GetZapLogger() *ZapLogger

func (ZapLogger) Debugf added in v1.4.0

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

func (ZapLogger) Errorf added in v1.4.0

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

func (ZapLogger) Fatalf added in v1.4.0

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

func (ZapLogger) GetEncoder added in v1.4.0

func (logger ZapLogger) GetEncoder() zapcore.Encoder

func (ZapLogger) GetEncoderConfig added in v1.4.0

func (logger ZapLogger) GetEncoderConfig() zapcore.EncoderConfig

func (ZapLogger) GetLevel added in v1.4.0

func (logger ZapLogger) GetLevel() *zapapi.AtomicLevel

func (ZapLogger) Infof added in v1.4.0

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

func (ZapLogger) IsDebugEnabled added in v1.4.0

func (zap ZapLogger) IsDebugEnabled() bool

func (ZapLogger) IsTraceEnabled added in v1.4.0

func (zap ZapLogger) IsTraceEnabled() bool

func (ZapLogger) Prettyf added in v1.4.0

func (zap ZapLogger) Prettyf(msg string, obj interface{})

func (ZapLogger) Secretf added in v1.4.0

func (zap ZapLogger) Secretf(format string, args ...interface{})

func (ZapLogger) SetLogLevel added in v1.4.0

func (zap ZapLogger) SetLogLevel(level int)

func (ZapLogger) Tracef added in v1.4.0

func (zap ZapLogger) Tracef(format string, args ...interface{})

func (ZapLogger) V added in v1.5.1

func (zap ZapLogger) V(level int) Verbose

func (ZapLogger) Warnf added in v1.4.0

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

func (ZapLogger) WithValues added in v1.4.2

func (zap ZapLogger) WithValues(keysAndValues ...interface{}) Logger

Jump to

Keyboard shortcuts

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