logging

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package logging centralizes slog setup + a Fatal helper for standalone Go agents that depend on agent-kit-go, so every agent emits the same structured log shape without each one wiring its own handler.

Usage in an agent's main:

func main() {
    logger := logging.Setup(os.Getenv("LOG_LEVEL"))
    logger.Info("agent starting", "node", cfg.NodeName)
    ...
    if err := boot(); err != nil {
        logging.Fatal("boot failed", "error", err)
    }
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatal

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

Fatal logs an error-level record then calls os.Exit(1).

func Setup

func Setup(level string) *slog.Logger

Setup parses level (debug|info|warn|error; defaults to info), wires it into the default slog logger using a JSON handler against stderr (or text if LOGUTIL_FORMAT=text), and returns the same logger.

Types

This section is empty.

Jump to

Keyboard shortcuts

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