Documentation
¶
Overview ¶
Package log provides centralized logging for the Tusk CLI.
Index ¶
- Variables
- func Debug(msg string, args ...any)
- func Error(msg string, args ...any)
- func Info(msg string, args ...any)
- func Print(msg string)
- func Println(msg string)
- func ServiceLog(msg string)
- func SetMode(mode OutputMode)
- func SetTUILogger(tui TUILogger)
- func Setup(debug bool, mode OutputMode)
- func Shutdown()
- func Stderr(msg string)
- func Stderrln(msg string)
- func TestLog(testID, msg string)
- func TestOrServiceLog(testID, msg string)
- func UserDeviation(msg string)
- func UserError(msg string)
- func UserInfo(msg string)
- func UserProgress(msg string)
- func UserSuccess(msg string)
- func UserWarn(msg string)
- func Warn(msg string, args ...any)
- type Handler
- type Logger
- type OutputMode
- type TUILogger
Constants ¶
This section is empty.
Variables ¶
var DeviationStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("208"))
DeviationStyle is orange for deviation messages
Functions ¶
func ServiceLog ¶
func ServiceLog(msg string)
ServiceLog logs a message to the TUI service panel Non-blocking: returns immediately, message is queued for processing
func SetTUILogger ¶
func SetTUILogger(tui TUILogger)
SetTUILogger sets the TUI logger (called when TUI starts)
func Setup ¶
func Setup(debug bool, mode OutputMode)
Setup configures the singleton logger (call once at startup)
func TestLog ¶
func TestLog(testID, msg string)
TestLog logs a message to a specific test's log panel Non-blocking: returns immediately, message is queued for processing
func TestOrServiceLog ¶
func TestOrServiceLog(testID, msg string)
TestOrServiceLog tries to log to test, falls back to service if testID is empty
func UserDeviation ¶
func UserDeviation(msg string)
UserDeviation prints a deviation/warning-level message (orange color)
func UserProgress ¶
func UserProgress(msg string)
UserProgress prints a progress/dim message to the user
func UserSuccess ¶
func UserSuccess(msg string)
UserSuccess prints a styled success message to the user
Types ¶
type Handler ¶
type Handler struct {
*slog.TextHandler
// contains filtered or unexported fields
}
Handler wraps slog.TextHandler with mode-awareness
func NewHandler ¶
func NewHandler(w io.Writer, opts *slog.HandlerOptions) *Handler
NewHandler creates a new mode-aware slog handler
type OutputMode ¶
type OutputMode int
OutputMode determines how user-facing output is rendered
const ( // ModeTUI indicates the TUI is active - user output goes to TUI panels ModeTUI OutputMode = iota // ModeHeadless indicates headless/print mode - user output goes to stdout ModeHeadless )