sbragi

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 89

Documentation

Index

Constants

View Source
const (
	LevelTrace   = slog.Level(-8)
	LevelDebug   = slog.LevelDebug
	LevelInfo    = slog.LevelInfo
	LevelNotice  = slog.Level(2)
	LevelWarning = slog.LevelWarn
	LevelError   = slog.LevelError
	LevelFatal   = slog.Level(12)
)

Variables

This section is empty.

Functions

func Debug

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

func Error

func Error(msg string, args ...any) bool

func Fatal

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

func Info

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

func NewDebugLogger added in v0.6.8

func NewDebugLogger() (logger, error)

func NewHandlerInFolder

func NewHandlerInFolder(path string) (h handler, err error)

func NewLogger

func NewLogger(handler slog.Handler) (logger, error)

func Notice

func Notice(msg string, args ...any) bool

func Trace

func Trace(msg string, args ...any) bool

func Warning

func Warning(msg string, args ...any) bool

Types

type ErrorLogger added in v0.8.0

type ErrorLogger interface {
	Trace(msg string, args ...any) bool
	Debug(msg string, args ...any) bool
	Info(msg string, args ...any) bool
	Notice(msg string, args ...any) bool
	Warning(msg string, args ...any) bool
	Error(msg string, args ...any) bool
	Fatal(msg string, args ...any)
}

func WithError

func WithError(err error) ErrorLogger

func WithErrorFunc added in v0.8.0

func WithErrorFunc(errf func() error) ErrorLogger

type Logger

type Logger interface {
	ErrorLogger
	WithError(err error) ErrorLogger
	WithErrorFunc(errf func() error) ErrorLogger
	WithoutEscalation() Logger
	SetDefault()
}

func WithoutEscalation added in v0.7.2

func WithoutEscalation() Logger

type RedactedString added in v0.6.7

type RedactedString string

func (RedactedString) LogValue added in v0.6.7

func (RedactedString) LogValue() slog.Value

func (RedactedString) String added in v0.6.7

func (r RedactedString) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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