slogd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelTrace   = slog.Level(-8)
	LevelDebug   = slog.LevelDebug
	LevelInfo    = slog.LevelInfo
	LevelNotice  = slog.Level(2)
	LevelWarn    = slog.LevelWarn
	LevelError   = slog.LevelError
	LevelFatal   = slog.Level(12)
	LevelDefault = LevelInfo
)
View Source
const (
	HandlerText string = "text"
	HandlerJSON string = "json"
)

Variables

This section is empty.

Functions

func ActiveHandler

func ActiveHandler() string

func Disable

func Disable()

func FromContext

func FromContext(ctx context.Context) *slog.Logger

func GetLevel

func GetLevel() slog.Level

func GetLevelString

func GetLevelString() string

func HandlerOptions

func HandlerOptions() *slog.HandlerOptions

func Init

func Init(l slog.Level, addSource bool)

func Level

func Level(l string) slog.Level

func LevelName

func LevelName(l slog.Level) string

func Logger

func Logger() *slog.Logger

func RegisterFormatter

func RegisterFormatter(f slogformatter.Formatter)

func RegisterJSONHandler

func RegisterJSONHandler(w io.Writer, activate bool)

func RegisterMiddleware

func RegisterMiddleware(h slogmulti.Middleware)

func RegisterSink

func RegisterSink(name string, h slog.Handler, activate bool)

func RegisterTextHandler

func RegisterTextHandler(w io.Writer, activate bool)

func ReplaceAttrs

func ReplaceAttrs(groups []string, a slog.Attr) slog.Attr

func SetLevel

func SetLevel(l slog.Level)

func UseHandler

func UseHandler(name string)

func WithContext

func WithContext(ctx context.Context) context.Context

Types

type Flow

type Flow int
const (
	FlowFanOut Flow = iota
	FlowPipeline
	FlowRouting
	FlowFailOver
	FlowLoadBalancing
)

Jump to

Keyboard shortcuts

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