Documentation
¶
Overview ¶
Package logctl owns the process-wide slog handler so settings toggles can flip the log level at runtime without restarting the container. Install() must be called once at startup; SetDebug adjusts the level on a shared slog.LevelVar that the handler follows.
Level choices:
- debug=false → slog.LevelInfo (default; production chatty-ish but not noisy)
- debug=true → slog.LevelDebug (surfaces the slog.Debug lines in translateACPEvent's default case, fs handler details, and bridge stdin/stdout sampling)
The setting reads from <configDir>/config.json `debug_logs` (bool). Install reads it once to pick the boot level; the handler writes Info or Debug based on whatever the LevelVar says at log time, so the PATCH endpoint that flips the bool also flips the level for subsequent calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install wires the shared LevelVar into slog's default logger and reads the initial level from configDir/config.json. Call exactly once at startup, before any other slog calls that matter.
The handler is installed at info first (via slogx.Setup, which returns the LevelVar the handler follows), then promoted to debug only when debug_logs is present and true. Parse failures (corrupt JSON, wrong type on debug_logs) or a legitimately-missing config.json (first boot) leave it at info, so a broken settings file never accidentally drops the user into debug mode.
Types ¶
This section is empty.