Documentation
¶
Overview ¶
Package logger provides a structured logging interface for the Kure library. It supports different log levels (Debug, Info, Warn, Error) and can be configured with verbosity settings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
Helper function to format durations in a human-readable way
Types ¶
type Logger ¶
type Logger interface {
// Debug logs a debug message (only shown in verbose/debug mode)
Debug(format string, args ...any)
// Info logs an informational message
Info(format string, args ...any)
// Warn logs a warning message
Warn(format string, args ...any)
// Error logs an error message
Error(format string, args ...any)
// WithPrefix returns a new logger with an additional prefix
WithPrefix(prefix string) Logger
// SetLevel sets the minimum log level
SetLevel(level Level)
}
Logger is the interface for structured logging in Kure
type Options ¶
type Options struct {
// Output is where logs are written (default: os.Stderr)
Output io.Writer
// Level is the minimum log level (default: LevelInfo)
Level Level
// Prefix is the log prefix (default: empty)
Prefix string
// ShowTimestamp indicates whether to include timestamps (default: true)
ShowTimestamp bool
}
Options configures a logger instance
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns the default logger options
Click to show internal directories.
Click to hide internal directories.