Documentation
¶
Overview ¶
Package ui provides colored console output with a nautical theme. It wraps the structured logging package to provide a user-friendly CLI experience.
Index ¶
- Variables
- func Anchor(format string, args ...any)
- func Compass(format string, args ...any)
- func Debug(format string, args ...any)
- func Error(format string, args ...any)
- func Fatal(format string, args ...any)
- func Fatalf(format string, args ...any)
- func Header(format string, args ...any)
- func Info(format string, args ...any)
- func Logger() *zerolog.Logger
- func Mayday(format string, args ...any)
- func Package(format string, args ...any)
- func SetExitFn(fn func(int)) func(int)
- func Ship(format string, args ...any)
- func Snapshot(format string, args ...any)
- func Step(n int, format string, args ...any)
- func Success(format string, args ...any)
- func Warning(format string, args ...any)
- func WithComponent(component string) zerolog.Logger
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Debug ¶ added in v0.2.10
Debug prints a debug message (only visible when debug level is enabled). In console mode, prints in gray.
func Logger ¶ added in v0.2.10
Logger returns a zerolog.Logger for structured logging with additional fields. Use this when you need to add structured fields to a log entry.
func SetExitFn ¶ added in v0.30.0
SetExitFn replaces the exit function used by Fatal/Fatalf and returns the previous one. Intended for test use only — not goroutine-safe. Call from the test goroutine before exercising code that may call Fatal. Usage: `old := ui.SetExitFn(func(int) {}); t.Cleanup(func() { ui.SetExitFn(old) })`
func Success ¶
Success prints a green success message with checkmark. In JSON mode, logs as info level with success=true.
func WithComponent ¶ added in v0.2.10
WithComponent returns a logger with the component field set.
Types ¶
This section is empty.