logger

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, args ...any)

func Debugf

func Debugf(message string, args ...any)

func Error

func Error(msg string, err error, args ...any)

func Errorf

func Errorf(message string, args ...any)

func Fatal

func Fatal(msg string, err error, args ...any)

func Fatalf

func Fatalf(message string, args ...any)

func Info

func Info(msg string, args ...any)

func Infof

func Infof(message string, args ...any)

func LogDefferedMessage

func LogDefferedMessage()

func NewLogger

func NewLogger(logfile string, opts *Options) error

NewLogger функция, которая создает и сохраняет новый экземпляр логгера. Первым параметром передается путь к лог файлу, а вторым - параметры для его настройки. Можно оставить nil, тогда параметры будут иметь дефолтные значения.

func SaveDebugf

func SaveDebugf(message string, args ...any)

func Warn

func Warn(msg string, args ...any)

func Warnf

func Warnf(message string, args ...any)

Types

type Logger

type Logger struct {
	*slog.Logger
}

func GetLogger

func GetLogger() *Logger

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

type Options

type Options struct {
	Debug    bool
	MoreInfo bool
	Stdout   bool
}

Jump to

Keyboard shortcuts

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