log

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package log provides the ecosystem's canonical logger factory: one place decides handler format and verbosity from the environment and debug switch so every binary logs consistently (KWL-P8W2N KWL-LOGV-004).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrAttrs added in v0.2.0

func ErrAttrs(err error) []slog.Attr

ErrAttrs converts the diagnostic attributes attached to err into slog attributes so structured context travels from the error into log records (KWL-P8W2N KWL-ERRV-008).

func Install

func Install(env core.Env, debug bool) *slog.Logger

Install makes Setup's logger the process default and returns it.

func LogError added in v0.2.0

func LogError(l *slog.Logger, msg string, err error)

LogError logs msg at Error level with the error's message plus any attached attrs and nearest hint as structured fields.

func Setup

func Setup(env core.Env, debug bool) *slog.Logger

Setup returns the process logger for env/debug, writing to stderr:

  • debug on: Debug level with source references
  • env production: JSON records at Info level
  • otherwise: text records at Info level

Types

This section is empty.

Jump to

Keyboard shortcuts

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