logging

package
v0.0.0-...-5bb8762 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StringToLevel = map[string]Level{
	"debug": DebugLevel,
	"info":  InfoLevel,
	"warn":  WarnLevel,
	"error": ErrorLevel,
	"panic": PanicLevel,
	"fatal": FatalLevel,
}

StringToStatusType converts string to status

Functions

This section is empty.

Types

type Default

type Default struct {
	Logger *log.Logger
}

func NewDefault

func NewDefault() (*Default, error)

func (*Default) Debugf

func (f *Default) Debugf(v ...interface{})

func (*Default) Errorf

func (f *Default) Errorf(v ...interface{})

func (*Default) Fatalf

func (f *Default) Fatalf(v ...interface{})

func (*Default) Infof

func (f *Default) Infof(v ...interface{})

func (*Default) Panicf

func (f *Default) Panicf(v ...interface{})

func (*Default) Println

func (f *Default) Println(v ...interface{})

func (*Default) Warnf

func (f *Default) Warnf(v ...interface{})

type Level

type Level int8
const (
	// DebugLevel logs are typically voluminous, and are usually disabled in
	// production.
	DebugLevel Level = iota - 1
	// InfoLevel is the default logging priority.
	InfoLevel
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	WarnLevel
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	ErrorLevel
	// DPanicLevel logs are particularly important errors. In development the
	// logger panics after writing the message.
	DPanicLevel
	// PanicLevel logs a message, then panics.
	PanicLevel
	// FatalLevel logs a message, then calls os.Exit(1).
	FatalLevel
)

func ToLevel

func ToLevel(l string) (Level, error)

type Logrus

type Logrus struct {
	Logger *logrus.Logger
}

func (*Logrus) Debugf

func (f *Logrus) Debugf(v ...interface{})

func (*Logrus) Errorf

func (f *Logrus) Errorf(v ...interface{})

func (*Logrus) Fatalf

func (f *Logrus) Fatalf(v ...interface{})

func (*Logrus) Infof

func (f *Logrus) Infof(v ...interface{})

func (*Logrus) Panicf

func (f *Logrus) Panicf(v ...interface{})

func (*Logrus) Println

func (f *Logrus) Println(v ...interface{})

func (*Logrus) Warnf

func (f *Logrus) Warnf(v ...interface{})

type SimpleLogger

type SimpleLogger interface {
	Println(v ...interface{})
	Debugf(v ...interface{})
	Infof(v ...interface{})
	Warnf(v ...interface{})
	Errorf(v ...interface{})
	Panicf(v ...interface{})
	Fatalf(v ...interface{})
}

func NewLogrus

func NewLogrus(dst ...string) (SimpleLogger, error)

type Wrapper

type Wrapper struct {
	Log    SimpleLogger
	Prefix []interface{}
	Level  Level
}

func (*Wrapper) Debugf

func (w *Wrapper) Debugf(i ...interface{})

func (*Wrapper) Errorf

func (w *Wrapper) Errorf(i ...interface{})

func (*Wrapper) Fatalf

func (w *Wrapper) Fatalf(i ...interface{})

func (*Wrapper) Infof

func (w *Wrapper) Infof(i ...interface{})

func (*Wrapper) Panicf

func (w *Wrapper) Panicf(i ...interface{})

func (*Wrapper) Println

func (w *Wrapper) Println(i ...interface{})

func (*Wrapper) Warnf

func (w *Wrapper) Warnf(i ...interface{})

type ZapSugar

type ZapSugar struct {
	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewZap

func NewZap(dst ...string) (*ZapSugar, error)

func NewZapConsole

func NewZapConsole(dst ...string) (*ZapSugar, error)

func NewZapSyslog

func NewZapSyslog(dst ...string) (*ZapSugar, error)

func (*ZapSugar) Debugf

func (f *ZapSugar) Debugf(v ...interface{})

func (*ZapSugar) Errorf

func (f *ZapSugar) Errorf(v ...interface{})

func (*ZapSugar) Fatalf

func (f *ZapSugar) Fatalf(v ...interface{})

func (*ZapSugar) Infof

func (f *ZapSugar) Infof(v ...interface{})

func (*ZapSugar) Panicf

func (f *ZapSugar) Panicf(v ...interface{})

func (*ZapSugar) Println

func (f *ZapSugar) Println(v ...interface{})

func (*ZapSugar) Warnf

func (f *ZapSugar) Warnf(v ...interface{})

Jump to

Keyboard shortcuts

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