logging

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package logging provides structured logging for AgentCTL using stdlib slog. Default level is Warn (silent in normal use). Enable debug with --debug flag or /debug command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

func Error

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

func Info

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

func Init

func Init(w io.Writer, debug bool)

Init configures the logger output and level.

func InitWithFile added in v0.0.34

func InitWithFile(debug bool) func()

InitWithFile sets up logging to both stderr and a log file. Returns a closer function. If file creation fails, logs to stderr only.

func IsDebug

func IsDebug() bool

IsDebug reports whether debug logging is active.

func LogDir added in v0.0.34

func LogDir() string

LogDir returns the log directory path.

func SessionID added in v0.0.34

func SessionID() string

SessionID generates a short unique session identifier.

func SetDebug

func SetDebug(on bool)

SetDebug toggles debug level at runtime (for /debug command).

func Span added in v0.0.34

func Span(op string, args ...any) func()

Span tracks the duration of an operation. Usage:

end := logging.Span("llm.stream", "model", model)
defer end()

func Warn

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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