logutil

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 2 Imported by: ? 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 logutil holds the lys libraries' single injectable logger. Library code is silent by default: failures come back as returned errors, and the events that are not failures — event-loop diagnostics, protocol warnings, protocol chatter — emit through the logger installed here, which starts as a discarding sink. An embedding application owns its logging and installs its *slog.Logger once at startup (Set, or lys-ui's app.SetLogger); passing nil restores the discarding default.

Levels

Debug — protocol chatter: optional globals the compositor does not advertise, capability changes, sub-object binds. Opt-in by level.

Info — unused. The library logs nothing per-frame or per-keypress, and nothing at Info at all.

Warn — degraded but running: an advertised optional protocol failed to bind and its feature silently disappears, a theme's contrast sits below WCAG AA. The session continues; the app decides whether it cares.

Error — terminal conditions only: the compositor raised a fatal protocol error against this client.

The lysdebug build-tag trace facility (package debug) is a different concern — compile-out traces, not runtime logging — and stays independent of this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func L

func L() *slog.Logger

L returns the active logger, never nil, so every emit site can log without a nil check. With the default configuration every record is discarded. Safe from any goroutine.

func Set

func Set(l *slog.Logger)

Set installs l as the library-wide logger. A nil l selects the discarding sink — the default, so "no logger configured" and "logger unset" mean the same thing. Safe from any goroutine.

Types

This section is empty.

Jump to

Keyboard shortcuts

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