Documentation
¶
Index ¶
Constants ¶
View Source
const LevelSuccess = slog.Level(2)
Custom log level for success (between Info and Warn)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsoleHandler ¶
type ConsoleHandler struct {
// contains filtered or unexported fields
}
ConsoleHandler formats logs for human-readable console output
func NewConsoleHandler ¶
func NewConsoleHandler(w io.Writer, opts *slog.HandlerOptions) *ConsoleHandler
NewConsoleHandler creates a handler that outputs user-friendly logs to the console
type Logger ¶
Logger wraps *slog.Logger to add a Success method
func NewSlogLogger ¶
func NewSlogLogger(cfg LoggerConfig) (*Logger, func() error)
NewSlogLogger creates a new Logger with console and optional file output Console output: human-readable with proper formatting File output: JSON with full trace details (when stack ID is known) Returns the logger and a cleanup function to close the file
type LoggerConfig ¶
type LoggerConfig struct {
StateDir string // Directory for log files
StackID string // Stack ID for grouping logs
}
LoggerConfig holds configuration for creating a logger
type MultiHandler ¶
type MultiHandler struct {
// contains filtered or unexported fields
}
MultiHandler sends logs to multiple handlers
func NewMultiHandler ¶
func NewMultiHandler(handlers ...slog.Handler) *MultiHandler
Click to show internal directories.
Click to hide internal directories.