log

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package log configures the default slog logger for repo CLIs.

Output is leveled and colored by default (via lmittmann/tint) when stderr is a TTY. Color is auto-disabled when stderr is not a TTY or when NO_COLOR is set in the environment. The --no-color flag and the --verbose flag on each root command both feed into Setup().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(opts Options)

Setup installs a tint-backed slog logger as the default. Call once near program start. Safe to call multiple times (re-initializes).

Types

type Options

type Options struct {
	Verbose bool // raise level to Debug
	NoColor bool // explicit --no-color flag; overrides TTY check
	Writer  io.Writer
}

Options controls logger initialization.

Jump to

Keyboard shortcuts

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