slogx

package
v0.0.0-...-e008491 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 6 Imported by: 13

Documentation

Index

Constants

View Source
const (
	LevelTrace = Level(slog.LevelDebug) - 1
	LevelDebug = Level(slog.LevelDebug)
	LevelInfo  = Level(slog.LevelInfo)
	LevelWarn  = Level(slog.LevelWarn)
	LevelError = Level(slog.LevelError)
)

Variables

View Source
var ErrUnknownFormat = errors.New("unknown format")

Functions

func FormatStrings

func FormatStrings() []string

func LevelStrings

func LevelStrings() []string

func LoggerTrace

func LoggerTrace(logger *slog.Logger, msg string, args ...any)

func Trace

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

Types

type Format

type Format uint8
const (
	FormatAuto Format = iota
	FormatColor
	FormatPlain
	FormatJSON
)

func (Format) MarshalJSON

func (f Format) MarshalJSON() ([]byte, error)

func (Format) MarshalText

func (f Format) MarshalText() ([]byte, error)

func (*Format) Set

func (f *Format) Set(s string) error

func (Format) String

func (f Format) String() string

func (Format) Type

func (f Format) Type() string

func (*Format) UnmarshalJSON

func (f *Format) UnmarshalJSON(i []byte) error

func (*Format) UnmarshalText

func (f *Format) UnmarshalText(text []byte) error

type Level

type Level slog.Level

func (Level) Level

func (l Level) Level() slog.Level

func (Level) MarshalJSON

func (l Level) MarshalJSON() ([]byte, error)

func (Level) MarshalText

func (l Level) MarshalText() ([]byte, error)

func (*Level) Set

func (l *Level) Set(s string) error

func (Level) String

func (l Level) String() string

func (Level) Type

func (l Level) Type() string

func (*Level) UnmarshalJSON

func (l *Level) UnmarshalJSON(i []byte) error

func (*Level) UnmarshalText

func (l *Level) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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