utilLogger

package
v0.0.0-...-eb9ff8e Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	LogLevelTrace = iota
	LogLevelDebug
	LogLevelInfo
	LogLevelWarn
	LogLevelError
	LogLevelFatal
	LogLevelPanic
)

Variables

This section is empty.

Functions

func Debug

func Debug(msg interface{})

func DebugF

func DebugF(format string, a ...any)

func Error

func Error(msg interface{})

func ErrorF

func ErrorF(format string, a ...any)

func Fatal

func Fatal(msg interface{})

func FatalF

func FatalF(format string, a ...any)

func Info

func Info(msg interface{})

func InfoF

func InfoF(format string, a ...any)

func NewFileRotationWriter

func NewFileRotationWriter(dir string, name string, maxBackups int, maxSize int, maxAge int) (w io.Writer, err error)

func Panic

func Panic(msg interface{})

func PanicF

func PanicF(format string, a ...any)

func SetDefaultLogger

func SetDefaultLogger(logger *Logger)

func Trace

func Trace(msg interface{})

func TraceF

func TraceF(format string, a ...any)

func Warn

func Warn(msg interface{})

func WarnF

func WarnF(format string, a ...any)

Types

type Logger

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

func NewLogger

func NewLogger() *Logger

func (*Logger) AddConsoleWriter

func (l *Logger) AddConsoleWriter() (err error)

func (*Logger) AddFileRotationWriter

func (l *Logger) AddFileRotationWriter(dir string, name string, maxBackups int, maxSize int, maxAge int) (err error)

func (*Logger) AddFileWriter

func (l *Logger) AddFileWriter(dest string) (err error)

func (*Logger) Debug

func (l *Logger) Debug(msg interface{})

func (*Logger) DebugF

func (l *Logger) DebugF(format string, a ...any)

func (*Logger) Error

func (l *Logger) Error(msg interface{})

func (*Logger) ErrorF

func (l *Logger) ErrorF(format string, a ...any)

func (*Logger) Fatal

func (l *Logger) Fatal(msg interface{})

func (*Logger) FatalF

func (l *Logger) FatalF(format string, a ...any)

func (*Logger) GetLevelWriter

func (l *Logger) GetLevelWriter() io.Writer

func (*Logger) Info

func (l *Logger) Info(msg interface{})

func (*Logger) InfoF

func (l *Logger) InfoF(format string, a ...any)

func (*Logger) Init

func (l *Logger) Init(force bool) *Logger

func (*Logger) Panic

func (l *Logger) Panic(msg interface{})

func (*Logger) PanicF

func (l *Logger) PanicF(format string, a ...any)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level int) (err error)

func (*Logger) SetTimeFormat

func (l *Logger) SetTimeFormat(format string) (err error)

func (*Logger) Trace

func (l *Logger) Trace(msg interface{})

func (*Logger) TraceF

func (l *Logger) TraceF(format string, a ...any)

func (*Logger) Warn

func (l *Logger) Warn(msg interface{})

func (*Logger) WarnF

func (l *Logger) WarnF(format string, a ...any)

Jump to

Keyboard shortcuts

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