Help us shape the future of Go! Take the 2026 Go Developer Survey

logging

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(level, sessionName string) *slog.Logger

Setup configures the global slog logger based on the given log level.

Supported levels: "off", "debug", "info", "warn", "error".

Logging is DISABLED by default: when level is "off", "none" or empty, every log call becomes a no-op (records are discarded). This keeps the terminal UI clean unless the user explicitly opts in via --log-level or rysh.config.yaml.

When level is "debug", logs are written to /tmp/rysh/logs/ in addition to stderr. The log file is named rysh-<session>-<timestamp>.log.

For "info", "warn" and "error", logs go to stderr only (colorized via tint).

func ValidLevel

func ValidLevel(level string) bool

ValidLevel returns true if the level string is a recognized log level. "off" and "none" are accepted as explicit ways to disable logging.

Types

This section is empty.

Jump to

Keyboard shortcuts

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