logging

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package logging provides structured JSONL logging for scut commands. Log files are written to ~/.scut/logging/ with date and component name in the filename. Files are rotated on open when they exceed 10 MB.

Index

Constants

This section is empty.

Variables

Discard is a no-op logger that discards all output. Use it when logging is disabled so callers don't need nil checks.

Functions

func LogParseError

func LogParseError(args []string, parseErr error)

LogParseError appends a JSONL record describing a kong parse failure to ~/.scut/logging/YYYYMMDD_parse-errors.jsonl. It is unconditional — parse errors are always bugs worth capturing, so no flag gates them. Failure to write is swallowed: losing the record must not prevent the parent process from seeing the original kong error on stderr.

func Open

func Open(name string, level slog.Level) (*slog.Logger, io.Closer, error)

Open creates or opens a JSONL log file for the named component (e.g. "post-tool-use", "status-line"). The file is placed at ~/.scut/logging/YYYYMMDD_<name>.jsonl.

If the file already exists and exceeds maxFileSize, it is rotated (renamed with a unix-second suffix) before opening a fresh file.

The returned io.Closer must be called when logging is complete.

Types

This section is empty.

Jump to

Keyboard shortcuts

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