logger

package
v0.3.17 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package logger provides the shared, level-gated diagnostic logger for cloudtab. It is a thin wrapper over log/slog writing to stderr so debug output never mixes with report output on stdout.

Default level is WARN: normal runs stay quiet except for genuine warnings (e.g. a disabled price cache). Passing --debug on the CLI switches the level to DEBUG, surfacing cache hits, retries, and per-call backend latency — enough to answer "why is this run slow / why was this SKU re-fetched" without attaching a debugger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

Debug logs at DEBUG level; a no-op unless SetDebug(true) was called.

func Info added in v0.3.16

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

Info logs at INFO level. INFO sits above the default WARN gate, so a plain Info call is normally suppressed; the end-of-run summary uses Summary (below) which writes to stderr unconditionally, independent of the level gate.

func SetDebug

func SetDebug(on bool)

SetDebug enables (or disables) debug-level logging on the shared logger.

func Summary added in v0.3.16

func Summary(line string)

Summary writes a single, already-formatted human-readable line to stderr, bypassing the slog level gate and its key=value formatting. It is used for the end-of-run summary so the line is legible and always shown, while report output on stdout stays untouched.

func Warn

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

Warn logs at WARN level; always visible.

Types

This section is empty.

Jump to

Keyboard shortcuts

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