obs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLevel = errors.New("invalid log level")

ErrInvalidLevel indicates a Config.Level value log/slog does not recognize.

Functions

func New

func New(cfg Config) (*slog.Logger, io.Closer, error)

New returns a logger that writes JSON records at cfg.Level, and a Closer for the underlying file. Disabled is the default and costs nothing: with Level == "" the logger discards everything and the Closer is a no-op, so no file is created, opened, or read - this is what keeps a disabled log from ever growing. A non-empty Level truncates an oversized log to its tail before opening it for append.

Types

type Config

type Config struct {
	Level    string // "", debug, info, warn, error - empty disables logging entirely
	Path     string // defaults to <projectDir>/.claude/hook-execution.log
	MaxBytes int64  // defaults to 256 KiB
}

Config selects where and whether hook telemetry is written.

Jump to

Keyboard shortcuts

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