Documentation
¶
Index ¶
- func Debug(msg string, args ...any)
- func Error(msg string, args ...any)
- func Fatal(msg string, args ...any)
- func GetDebugFilePath(defaultFileName string) string
- func Info(msg string, args ...any)
- func LogError(ctx context.Context, logger Logger, msg string, err error, args ...any)
- func LogErrorWithOperation(ctx context.Context, logger Logger, operation, msg string, err error, ...)
- func SetGlobalLogger(logger Logger)
- func Warn(msg string, args ...any)
- type Config
- type Format
- type Logger
- func GetGlobalLogger() Logger
- func NewAPILogger(service string) Logger
- func NewComponentLogger(component string) Logger
- func NewDefaultLogger() Logger
- func NewDisabledLogger() Logger
- func NewFileLoggerFromEnv(defaultFileName string) Logger
- func NewLogger(config Config) Logger
- func NewOperationLogger(component, operation string) Logger
- func NewPromptLogger(promptName string) Logger
- func NewQuietLogger() Logger
- func NewVerboseLogger() Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDebugFilePath ¶ added in v0.1.6
GetDebugFilePath returns the debug file path from environment variable or default
func LogErrorWithOperation ¶
func SetGlobalLogger ¶
func SetGlobalLogger(logger Logger)
SetGlobalLogger sets the global logger instance
Types ¶
type Logger ¶
type Logger interface {
Debug(msg string, args ...any)
Info(msg string, args ...any)
Warn(msg string, args ...any)
Error(msg string, args ...any)
With(args ...any) Logger
WithGroup(name string) Logger
SetLevel(level slog.Level) // Add method for dynamic level changes
}
Logger interface for dependency injection and testing
func GetGlobalLogger ¶
func GetGlobalLogger() Logger
GetGlobalLogger returns the global logger instance
func NewComponentLogger ¶
Component logger helpers for common use cases
func NewDefaultLogger ¶
func NewDefaultLogger() Logger
NewDefaultLogger creates a logger with sensible defaults for CLI tools
func NewDisabledLogger ¶ added in v0.1.6
func NewDisabledLogger() Logger
NewDisabledLogger creates a logger that discards all output (useful for tests)
func NewFileLoggerFromEnv ¶ added in v0.1.6
NewFileLoggerFromEnv creates a file-based logger using standard environment variables Uses GENIE_DEBUG_FILE for file path (defaults to temp file) and GENIE_DEBUG_LEVEL for level
func NewOperationLogger ¶
Operation logger for tracking operations with duration
func NewPromptLogger ¶
Prompt logger specifically for AI prompt operations
func NewQuietLogger ¶
func NewQuietLogger() Logger
NewQuietLogger creates a logger that only shows errors
func NewVerboseLogger ¶
func NewVerboseLogger() Logger
NewVerboseLogger creates a logger that shows debug information