cli

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsJSON added in v0.43.0

func IsJSON(c *ucli.Context) bool

func JSONFlag added in v0.43.0

func JSONFlag() ucli.Flag

func LoadDotEnv added in v0.43.0

func LoadDotEnv()

LoadDotEnv reads $STELLA_HOME/.env and sets any key that is not already present in the environment. Existing OS/service-injected variables win. Missing file is silently ignored; parse errors are skipped per line.

func NewMinLevelHandler added in v0.60.0

func NewMinLevelHandler(min slog.Level, next slog.Handler) slog.Handler

NewMinLevelHandler wraps next and drops records below min, regardless of what next would accept. It exists so chatty subsystem loggers (e.g. the River job queue, which heartbeats at DEBUG/INFO every few seconds) can be capped independently of the process-wide LOG_LEVEL.

func ParseLogLevel added in v0.43.0

func ParseLogLevel(raw string) slog.Level

ParseLogLevel maps a LOG_LEVEL value to slog.Level. Supported values: TRACE, DEBUG, INFO, WARN, ERROR (case-insensitive). Defaults to INFO if empty or unrecognized. It is a pure function of its argument: logging is configured before the server config is parsed, so the caller (main) passes the raw environment value.

func PrintJSON added in v0.43.0

func PrintJSON(c *ucli.Context, v any) error

Types

type LineWriter added in v0.43.0

type LineWriter struct {
	// contains filtered or unexported fields
}

LineWriter is a fmt-style writer bound to a command's stdout that defers error handling: it records the first write error and short-circuits the rest, so human-output helpers check once at the end (via Err) instead of after every line.

func Stdout added in v0.43.0

func Stdout(c *ucli.Context) *LineWriter

func (*LineWriter) Err added in v0.43.0

func (l *LineWriter) Err() error

func (*LineWriter) Printf added in v0.43.0

func (l *LineWriter) Printf(format string, a ...any)

func (*LineWriter) Println added in v0.43.0

func (l *LineWriter) Println(a ...any)

Jump to

Keyboard shortcuts

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