log

package
v0.5.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package log provides structured logging with INFO, DEBUG, and TRACE levels. DEBUG is visible by default; TRACE requires explicit opt-in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, args ...interface{})

Debug logs at DEBUG level - state values, decision reasoning, paths taken.

func DryRunPrefix

func DryRunPrefix() string

DryRunPrefix returns a prefix for dry-run mode messages.

func EnableTrace

func EnableTrace()

EnableTrace sets the log level to TRACE.

func Error

func Error(format string, args ...interface{})

Error logs an error message (always visible).

func Info

func Info(format string, args ...interface{})

Info logs at INFO level - key actions like "promoting X to Y".

func Section

func Section(title string)

Section logs a section header for organizing output.

func SetColors

func SetColors(enabled bool)

SetColors enables or disables ANSI color codes.

func SetLevel

func SetLevel(l Level)

SetLevel sets the logging level for the default logger.

func SetOutput

func SetOutput(w io.Writer)

SetOutput sets the output writer for the default logger.

func Trace

func Trace(format string, args ...interface{})

Trace logs at TRACE level - detailed internals, API calls, full payloads.

func Warn

func Warn(format string, args ...interface{})

Warn logs a warning message (always visible).

Types

type Level

type Level int

Level represents a logging level.

const (
	// LevelInfo shows key actions only.
	LevelInfo Level = iota
	// LevelDebug shows state values, decision reasoning, paths taken.
	LevelDebug
	// LevelTrace shows detailed internals, API calls, full payloads.
	LevelTrace
)

func ParseLevel

func ParseLevel(s string) Level

ParseLevel parses a string into a Level.

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger provides structured logging functionality.

Jump to

Keyboard shortcuts

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