Documentation
¶
Index ¶
- Constants
- func ActiveHandler() string
- func Disable()
- func FromContext(ctx context.Context) *slog.Logger
- func GetLevel() slog.Level
- func GetLevelString() string
- func HandlerOptions() *slog.HandlerOptions
- func Init(l slog.Level, addSource bool)
- func Level(l string) slog.Level
- func LevelName(l slog.Level) string
- func Logger() *slog.Logger
- func RegisterFormatter(f slogformatter.Formatter)
- func RegisterJSONHandler(w io.Writer, activate bool)
- func RegisterMiddleware(h slogmulti.Middleware)
- func RegisterSink(name string, h slog.Handler, activate bool)
- func RegisterTextHandler(w io.Writer, activate bool)
- func ReplaceAttrs(groups []string, a slog.Attr) slog.Attr
- func SetLevel(l slog.Level)
- func UseHandler(name string)
- func WithContext(ctx context.Context) context.Context
- type Flow
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 GetLevelString ¶
func GetLevelString() string
func HandlerOptions ¶
func HandlerOptions() *slog.HandlerOptions
func RegisterFormatter ¶
func RegisterFormatter(f slogformatter.Formatter)
func RegisterJSONHandler ¶
func RegisterMiddleware ¶
func RegisterMiddleware(h slogmulti.Middleware)
func RegisterTextHandler ¶
func UseHandler ¶
func UseHandler(name string)
Types ¶
Click to show internal directories.
Click to hide internal directories.