logging

package
v0.71.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logging configures the process-wide slog logger: structured text with source file:line on every record, mirrored to stderr and a persistent file under the lich config dir. The file is the audit trail — it is what remains on Windows once the GUI-subsystem build drops the console, and what a bug report quotes. The session token is never logged: the file outlives the session that would have made it useful.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(dir string) (io.Closer, error)

Init points slog's default logger at stderr plus <dir>/lich.log (lich-dev.log under LICH_DEV, mirroring the store's database split), with the level taken from LICH_LOG_LEVEL (debug|warn|error; default info), and routes the runtime's crash output to the same file. The returned closer owns the file. When the file cannot be opened, logging still works on stderr alone: the closer is nil and the error says why the persistent half is missing — the caller reports it and carries on.

func NativePath

func NativePath(dir string) string

NativePath is the file OpenNative writes to under dir, for a bug report to attach beside Path's.

func OpenNative

func OpenNative(dir string) (*os.File, error)

OpenNative opens the native window's log under dir, lich-native.log (lich-native-dev.log under LICH_DEV), rotated as lich.log is. A native window started detached has no terminal: its stdout and stderr go here, and so does a crash or a stalled event loop it reports.

func Path

func Path(dir string) string

Path is the file Init writes to under dir — what a bug report attaches, and the only place the naming rule below is readable from outside the package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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