logger

package
v0.0.0-...-3928268 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, v ...any)

Debug debug log

func Error

func Error(format string, v ...any)

Error error log

func Fatal

func Fatal(format string, v ...any)

Fatal fatal log and exit

func Info

func Info(format string, v ...any)

Info info log

func Panic

func Panic(format string, v ...any)

Panic panic log and cause a panic

func Pure

func Pure(format string, v ...any)

Pure pure log

func RegisterLogger

func RegisterLogger(writer io.Writer)

RegisterLogger register a logger

func Warn

func Warn(format string, v ...any)

Warn warning log

Types

type DefaultLogger

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

DefaultLogger default logger

func NewDefaultLogger

func NewDefaultLogger(logger ...*log.Logger) *DefaultLogger

NewDefaultLogger create a default logger

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(stackoffset int, format string, v ...any)

Debug debug log

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(stackoffset int, format string, v ...any)

Error error log

func (*DefaultLogger) Fatal

func (l *DefaultLogger) Fatal(stackoffset int, format string, v ...any)

Fatal fatal log and exit

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(stackoffset int, format string, v ...any)

Info info log

func (*DefaultLogger) Panic

func (l *DefaultLogger) Panic(stackoffset int, format string, v ...any)

Panic panic log and cause a panic

func (*DefaultLogger) Pure

func (l *DefaultLogger) Pure(stackoffset int, format string, v ...any)

Pure pure log

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn(stackoffset int, format string, v ...any)

Warn warning log

type Logger

type Logger interface {
	Pure(stackoffset int, format string, v ...any)
	Info(stackoffset int, format string, v ...any)
	Warn(stackoffset int, format string, v ...any)
	Error(stackoffset int, format string, v ...any)
	Panic(stackoffset int, format string, v ...any)
	Fatal(stackoffset int, format string, v ...any)
	Debug(stackoffset int, format string, v ...any)
}

Logger application logger stackoffset is used to locate the position of the log in the calling stack

Jump to

Keyboard shortcuts

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