logger

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLogger added in v0.7.0

type FileLogger struct {
	Logger   *log.Logger
	LogLevel LogLevel
}

FileLogger ...

func (*FileLogger) CloneWithLevel added in v0.7.0

func (l *FileLogger) CloneWithLevel(level LogLevel) Logger

CloneWithLevel ...

func (*FileLogger) Debugf added in v0.7.0

func (l *FileLogger) Debugf(f string, v ...interface{})

Debugf ...

func (*FileLogger) Errorf added in v0.7.0

func (l *FileLogger) Errorf(f string, v ...interface{})

Errorf ...

func (*FileLogger) Infof added in v0.7.0

func (l *FileLogger) Infof(f string, v ...interface{})

Infof ...

func (*FileLogger) Warningf added in v0.7.0

func (l *FileLogger) Warningf(f string, v ...interface{})

Warningf ...

type LogLevel

type LogLevel int8

LogLevel ...

const (
	LogDebug LogLevel = iota
	LogInfo
	LogWarn
	LogError
)

Log levels

type Logger

type Logger interface {
	Errorf(string, ...interface{})
	Warningf(string, ...interface{})
	Infof(string, ...interface{})
	Debugf(string, ...interface{})
	CloneWithLevel(level LogLevel) Logger
}

Logger ...

func NewFileLogger

func NewFileLogger(name string, file string) (logger Logger, out *os.File, err error)

NewFileLogger ...

func NewFileLoggerWithLevel

func NewFileLoggerWithLevel(name string, file string, level LogLevel) (logger Logger, out *os.File, err error)

NewFileLoggerWithLevel ...

func NewSimpleLogger

func NewSimpleLogger(name string, out io.Writer) Logger

NewSimpleLogger ...

func NewSimpleLoggerWithLevel

func NewSimpleLoggerWithLevel(name string, out io.Writer, level LogLevel) Logger

NewSimpleLoggerWithLevel ...

type SimpleLogger added in v0.7.0

type SimpleLogger struct {
	Logger   *log.Logger
	LogLevel LogLevel
}

SimpleLogger ...

func (*SimpleLogger) CloneWithLevel added in v0.7.0

func (l *SimpleLogger) CloneWithLevel(level LogLevel) Logger

CloneWithLevel ...

func (*SimpleLogger) Debugf added in v0.7.0

func (l *SimpleLogger) Debugf(f string, v ...interface{})

Debugf ...

func (*SimpleLogger) Errorf added in v0.7.0

func (l *SimpleLogger) Errorf(f string, v ...interface{})

Errorf ...

func (*SimpleLogger) Infof added in v0.7.0

func (l *SimpleLogger) Infof(f string, v ...interface{})

Infof ...

func (*SimpleLogger) Warningf added in v0.7.0

func (l *SimpleLogger) Warningf(f string, v ...interface{})

Warningf ...

Jump to

Keyboard shortcuts

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