logging

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package logging configures the process-wide structured logger for the CLI.

Default level is Warn (quiet by default, per CLI convention); --debug lifts it to Debug. Output is a human-readable text handler on stderr unless JSON is requested (--log-json), in which case a JSON handler is used.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(opts Options) *slog.Logger

Setup installs the default slog logger from opts and returns it. Level is Warn by default, Debug when opts.Debug is set.

Types

type Options

type Options struct {
	// Debug lowers the level from Warn to Debug.
	Debug bool
	// JSON selects the JSON handler instead of the text handler.
	JSON bool
	// Version, when non-empty, is attached to every log entry.
	Version string
}

Options controls logger construction.

Jump to

Keyboard shortcuts

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