log

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package log is a thin wrapper around log/slog that writes structured logs to stderr. Use Warn/Error for actionable issues; Info for startup banners and status lines. Also provides Close helper for safe resource cleanup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(name string, c interface{ Close() error })

Close closes c and writes a warning to stderr on error. name identifies the resource in the log message. Use for deferred Close() calls where the error is not actionable (best-effort cleanup).

func CloseSimple

func CloseSimple(name string, c interface{ Close() })

CloseSimple is like Close but for types whose Close method returns nothing.

func Debug

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

Debug logs at Debug level.

func Error

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

Error logs at Error level.

func Info

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

Info logs at Info level.

func Warn

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

Warn logs at Warn level.

Types

This section is empty.

Jump to

Keyboard shortcuts

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