diag

package
v0.72.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

ABOUTME: Injectable diagnostic sink for tracker's library packages (#449). ABOUTME: Defaults to a no-op so embedders get silence unless they inject a logger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(format string, args ...any)

Errorf logs a formatted error-level diagnostic to the active sink. Note this does NOT swallow an error return — call sites that previously logged context alongside returning/handling an error keep doing so; only the sink changes.

func Infof

func Infof(format string, args ...any)

Infof logs a formatted informational note to the active sink.

func Logger

func Logger() *slog.Logger

Logger returns the active diagnostic sink. It never returns nil — when no logger has been injected it returns the no-op sink, so callers can log unconditionally without a nil check.

func SetLogger

func SetLogger(l *slog.Logger)

SetLogger installs the process-wide diagnostic sink used by tracker's library packages (pipeline, handlers, llm, root). Passing nil resets to the no-op sink. This is process-wide state, not per-engine: threading a logger through every free function (llm.EstimateCost, condition evaluation) is not feasible, so the library funnels all diagnostics through one injectable sink. tracker.Config.Logger sets this during engine construction; the CLI sets it once at startup to preserve its terminal output.

func Warnf

func Warnf(format string, args ...any)

Warnf logs a formatted warning to the active sink. The printf-style shape mirrors the log.Printf call sites it replaces so the migration is a mechanical per-site swap that preserves the exact message text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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