log

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfoLevel  logLevel = "info"
	DebugLevel logLevel = "debug"
	WarnLevel  logLevel = "warn"
	ErrorLevel logLevel = "error"
)

Variables

This section is empty.

Functions

func ParseLevel

func ParseLevel(str string) logLevel

Types

type Field

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

Field used for structured logging

func Bool added in v0.0.31

func Bool(key string, value bool) Field

func Error

func Error(value string) Field

func Int added in v0.0.31

func Int(key string, value int64) Field

func String

func String(key string, value string) Field

func (*Field) GetZapType added in v0.0.31

func (f *Field) GetZapType() zapcore.FieldType

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	WithFields(level logLevel, msg string, fields ...Field)
}

func NewDefaultLogger

func NewDefaultLogger(level logLevel) (Logger, error)

func NewZapLogger

func NewZapLogger(level logLevel) (Logger, error)

type ZapLogger

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

func (ZapLogger) Debug

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

func (ZapLogger) Debugf

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

func (ZapLogger) Error

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

func (ZapLogger) Errorf

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

func (ZapLogger) Fatal

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

func (ZapLogger) Fatalf

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

func (ZapLogger) Info

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

func (ZapLogger) Infof

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

func (ZapLogger) Warn

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

func (ZapLogger) Warnf

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

func (ZapLogger) WithFields

func (l ZapLogger) WithFields(level logLevel, msg string, fields ...Field)

Jump to

Keyboard shortcuts

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