log

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, args ...any)

Debug logs at LevelDebug using the global Kite logger.

func Enabled

func Enabled(level slog.Level) bool

Enabled reports whether the global Kite logger emits records at the given level.

func Error

func Error(msg string, args ...any)

Error logs at LevelError using the global Kite logger.

func Info

func Info(msg string, args ...any)

Info logs at LevelInfo using the global Kite logger.

func InitFromEnv

func InitFromEnv() (func() error, error)

func LogAttrs

func LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)

LogAttrs logs using the global Kite logger with specific attributes.

func Logger

func Logger() *slog.Logger

Logger returns the current global Kite logger.

func NewFileLogger

func NewFileLogger(path string, level slog.Level) (*slog.Logger, error)

NewFileLogger creates a JSON logger that writes to the specified file path.

func NewNoopLogger

func NewNoopLogger() *slog.Logger

NewNoopLogger creates a logger that safely discards all output. It is ideal as the default logger in a TUI to prevent screen corruption.

func SetLogger

func SetLogger(l *slog.Logger)

SetLogger allows the user to override Kite's internal logger. If nil is provided, it resets to a No-op logger.

func Warn

func Warn(msg string, args ...any)

Warn logs at LevelWarn using the global Kite logger.

func With

func With(args ...any) *slog.Logger

With returns a new Logger that includes the given arguments.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL