log

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package log provides access to log/slog structured logging with opinionated defaults and integration with flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

Debug logs a message with the given arguments at the Debug level

func DebugContext

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

DebugContext logs a message with the given arguments at the Debug level, using the specified context

func Error

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

Error logs a message with the given arguments at the Error level

func ErrorContext

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

ErrorContext logs a message with the given arguments at the Error level, using the specified context

func Info

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

Info logs a message with the given arguments at the Info level

func InfoContext

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

InfoContext logs a message with the given arguments at the Info level, using the specified context

func Log

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

Log logs a message with the given arguments at the specified level

func LogAttrs

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

LogAttrs logs a message with the given arguments at the specified level

func Warn

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

Warn logs a message with the given arguments at the Warn level

func WarnContext

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

WarnContext logs a message with the given arguments at the Warn level, using the specified context

func With

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

With returns a derived logger with attributes already set

Types

type Level

type Level = slog.Level

Jump to

Keyboard shortcuts

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