Documentation
¶
Overview ¶
Package log writes notable application events to ~/.config/perk-workbench/event.log. File-based — survives TUI restart, no truncation in a single-line footer. Entries below the configured level (SetLevel, built-in default Info) are dropped before reaching the file or the notifier. Safe for concurrent calls (async Bubble Tea commands).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(msg string)
Debug writes a timestamped debug entry. Silent on failure (best-effort).
func Error ¶
Error writes a timestamped error entry with an operation context. Silent on failure (best-effort); a nil error is a no-op.
func Info ¶
func Info(msg string)
Info writes a timestamped info entry. Silent on failure (best-effort).
func SetLevel ¶
func SetLevel(level Level)
SetLevel configures the minimum severity written to the event log and delivered to the notifier. Entries below the level are dropped entirely. The built-in default is Info; config.json "log_level" sets it at startup.
func SetNotifier ¶
func SetNotifier(fn func(Entry))
SetNotifier registers a callback invoked after each entry is written to the log file. The callback runs synchronously in the caller's goroutine, so it must be fast and must not itself call into this package. A nil callback disables notifications.