logging

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Overview

Package logging builds a configured *slog.Logger for the app.

The public surface is intentionally tiny: one Config, one constructor. Callers receive a *slog.Logger value and inject it where needed; the process-global slog.Default() is never modified.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) *slog.Logger

New returns a *slog.Logger writing structured records to stderr.

Types

type Config

type Config struct {
	Level  string `koanf:"level"  json:"level"  yaml:"level"`
	Format string `koanf:"format" json:"format" yaml:"format"`
}

Config selects the level and output format. Invalid or empty values fall back to info / text so a bad env var cannot prevent the app from starting.

Jump to

Keyboard shortcuts

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