logging

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ILogger

type ILogger interface {
	Tracef(format string, args ...any)
	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
	Errorf(format string, args ...any)
	Panicf(format string, args ...any)

	Traceln(args ...any)
	Debugln(args ...any)
	Infoln(args ...any)
	Warnln(args ...any)
	Errorln(args ...any)
	Panicln(args ...any)

	SetLevel(newLevel LogLevel)
}

func NewSimpleLogger

func NewSimpleLogger(initialLevel LogLevel) (ILogger, error)

type LogLevel

type LogLevel int
const (
	ErrorLevel LogLevel = iota
	WarnLevel
	InfoLevel
	DebugLevel
	TraceLevel
)

type SimpleLogger

type SimpleLogger struct {
	CurLevel     LogLevel
	NormalLogger *log.Logger
	ErrorLogger  *log.Logger
	Start        time.Time
}

func (*SimpleLogger) Debugf

func (l *SimpleLogger) Debugf(format string, args ...any)

func (*SimpleLogger) Debugln

func (l *SimpleLogger) Debugln(args ...any)

func (*SimpleLogger) Errorf

func (l *SimpleLogger) Errorf(format string, args ...any)

func (*SimpleLogger) Errorln

func (l *SimpleLogger) Errorln(args ...any)

func (*SimpleLogger) Infof

func (l *SimpleLogger) Infof(format string, args ...any)

func (*SimpleLogger) Infoln

func (l *SimpleLogger) Infoln(args ...any)

func (*SimpleLogger) Panicf

func (l *SimpleLogger) Panicf(format string, args ...any)

func (*SimpleLogger) Panicln

func (l *SimpleLogger) Panicln(args ...any)

func (*SimpleLogger) SetLevel

func (l *SimpleLogger) SetLevel(newLevel LogLevel)

func (*SimpleLogger) Tracef

func (l *SimpleLogger) Tracef(format string, args ...any)

func (*SimpleLogger) Traceln

func (l *SimpleLogger) Traceln(args ...any)

func (*SimpleLogger) Warnf

func (l *SimpleLogger) Warnf(format string, args ...any)

func (*SimpleLogger) Warnln

func (l *SimpleLogger) Warnln(args ...any)

Jump to

Keyboard shortcuts

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