logger

package
v0.0.0-...-f839f91 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset   = "\033[0m"
	Red     = "\033[31m"
	Yellow  = "\033[33m"
	Blue    = "\033[34m"
	Green   = "\033[32m"
	Magenta = "\033[35m"
)

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

func Debugf

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

func Debugln

func Debugln(args ...any)

func Error

func Error(msg string)

func Errorf

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

func Errorln

func Errorln(args ...any)

func Fatal

func Fatal(msg string)

func Fatalf

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

func Fatalln

func Fatalln(args ...any)

func Info

func Info(msg string)

func Infof

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

func Infoln

func Infoln(args ...any)

func SetLevel

func SetLevel(level Level)

func Warn

func Warn(msg string)

func Warnf

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

func Warnln

func Warnln(args ...any)

Types

type Level

type Level slog.Level
const (
	LevelDebug  Level = -4
	LevelInfo   Level = 0
	LevelWarn   Level = 4
	LevelError  Level = 8
	LevelSilent Level = 16
)

func GetLevel

func GetLevel() Level

type TextHandler

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

func NewTextHandler

func NewTextHandler(level slog.Level) *TextHandler

func (*TextHandler) Enabled

func (h *TextHandler) Enabled(_ context.Context, level slog.Level) bool

func (*TextHandler) Handle

func (h *TextHandler) Handle(_ context.Context, r slog.Record) error

func (*TextHandler) WithAttrs

func (h *TextHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*TextHandler) WithGroup

func (h *TextHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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