logutil

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

Debug logs at LevelDebug using the process-wide logger.

func DebugContext

func DebugContext(ctx context.Context, msg string, args ...any)

DebugContext logs at LevelDebug with context using the process-wide logger.

func Default

func Default() *slog.Logger

Default returns the current process-wide logger, analogous to slog.Default.

func Error

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

Error logs at LevelError using the process-wide logger.

func ErrorContext

func ErrorContext(ctx context.Context, msg string, args ...any)

ErrorContext logs at LevelError with context using the process-wide logger.

func Info

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

Info logs at LevelInfo using the process-wide logger.

func InfoContext

func InfoContext(ctx context.Context, msg string, args ...any)

InfoContext logs at LevelInfo with context using the process-wide logger.

func Log

func Log(ctx context.Context, level slog.Level, msg string, args ...any)

Log logs at the given level using the process-wide logger. Signature is identical to slog.Log.

func LogAttrs

func LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)

LogAttrs logs at the given level with pre-built attributes using the process-wide logger. Signature is identical to slog.LogAttrs.

func LogJSON

func LogJSON(v any)

func SetDefault

func SetDefault(logger *slog.Logger)

SetDefault sets the process-wide logger, analogous to slog.SetDefault.

func Warn

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

Warn logs at LevelWarn using the process-wide logger.

func WarnContext

func WarnContext(ctx context.Context, msg string, args ...any)

WarnContext logs at LevelWarn with context using the process-wide logger.

func With

func With(args ...any) *slog.Logger

With returns a logger that includes the supplied key/value pairs as attributes, rooted at the process-wide logger. Signature is identical to slog.With.

Types

This section is empty.

Jump to

Keyboard shortcuts

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