log

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package log provides structured logging via log/slog.

Configuration is via environment variables:

  • LOG_LEVEL: debug, info, warn, error (default: info)
  • LOG_FORMAT: json, text (default: json)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(w io.Writer) *slog.Logger

Init creates and returns a configured *slog.Logger based on environment variables. The returned logger should be stored and passed to subsystems that need logging.

func With

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

With returns a child logger with the given key-value attributes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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