slog

package
v1.0.260758 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package slog writes TTYPE Desk diagnostics to a rotating log file. Use this for troubleshooting crashes and UI issues without spoiling the TUI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close flushes and closes the log file.

func Debug

func Debug(format string, args ...any)

func Error

func Error(format string, args ...any)

func Guard

func Guard(where string, fn func()) (ok bool)

Guard runs fn and recovers panics, logging them. Returns true if fn completed without panic.

func Info

func Info(format string, args ...any)

func Init

func Init() error

Init opens the log file. Safe to call multiple times.

func Panic

func Panic(recovered any)

Panic logs a panic value and stack, then re-panics.

func Path

func Path() string

Path returns the default log file location.

func RecoverAndLog

func RecoverAndLog(where string) (panicked any)

RecoverAndLog recovers from panic in a defer, logs it, and returns the panic value (nil if none).

func Warn

func Warn(format string, args ...any)

func Writer

func Writer() io.Writer

Writer returns an io.Writer that appends as INFO lines (for optional redirection).

Types

type Level

type Level int
const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarn
	LevelError
)

func (Level) String

func (l Level) String() string

Jump to

Keyboard shortcuts

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