Documentation
¶
Overview ¶
Package log provides structured logging for Kite without writing over the terminal UI. Output is discarded by default. SetLogger installs a custom logger, and NewFileLogger creates a JSON file logger. InitFromEnv configures both Kite and slog using KITE_LOG_FILE and KITE_LOG_LEVEL and returns a cleanup function to close the log file.
Index ¶
- func Debug(msg string, args ...any)
- func Enabled(level slog.Level) bool
- func Error(msg string, args ...any)
- func Info(msg string, args ...any)
- func InitFromEnv() (func() error, error)
- func LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)
- func Logger() *slog.Logger
- func NewFileLogger(path string, level slog.Level) (*slog.Logger, error)
- func NewNoopLogger() *slog.Logger
- func SetLogger(l *slog.Logger)
- func Warn(msg string, args ...any)
- func With(args ...any) *slog.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitFromEnv ¶
func NewFileLogger ¶
NewFileLogger creates a JSON logger that writes to the specified file path.
func NewNoopLogger ¶
NewNoopLogger creates a logger that safely discards all output. It is ideal as the default logger in a TUI to prevent screen corruption.
Types ¶
This section is empty.