logx

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelOff   = "off"
	LevelError = "error"
	LevelWarn  = "warn"
	LevelInfo  = "info"
	LevelDebug = "debug"
)

Level names persisted in settings and FORTE_LOG_LEVEL.

Variables

This section is empty.

Functions

func Configure

func Configure(levelName string) error

Configure sets the global log level and writers. Logs are appended to ~/.config/forte/forte.log (alongside crash.log). When stderrOn, the same records are also written to stderr if the level allows.

func LevelName

func LevelName(level slog.Level) string

LevelName returns the canonical name for a slog level.

func LevelString

func LevelString() string

LevelString returns the canonical name of the active level.

func Logger

func Logger() *slog.Logger

Logger returns the configured application logger.

func ParseLevel

func ParseLevel(name string) slog.Level

ParseLevel maps a user-facing level string to slog.Level. Unknown values default to warn.

func Path

func Path() string

Path returns the log file path (empty until Configure succeeds).

func SlogLevel

func SlogLevel() slog.Level

SlogLevel returns the current minimum slog level.

func StartupLevel

func StartupLevel() string

StartupLevel returns FORTE_LOG_LEVEL when set, otherwise warn.

Types

This section is empty.

Jump to

Keyboard shortcuts

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