Documentation
¶
Overview ¶
Package dev provides tether's internal logging and development mode. All log output from the framework flows through this package so the logger is scoped to tether and never touches the process-wide slog default.
Warn and Debug are gated behind dev mode - they help developers catch mistakes early but would be noise in production. For production observability, subscribe to [tether.Handler].Diagnostics.
The package also provides Log for direct access to the scoped logger. The framework uses this for safety-net logging (panics, critical errors) that must always fire regardless of dev mode.
Call SetLogger at startup to configure the logger; when not set, the process-wide slog default is used as a fallback.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enable ¶
func Enable()
Enable activates dev-mode diagnostics. Called once during handler initialisation when App.DevMode is true or TETHER_DEV is set.
func Log ¶
Log returns tether's scoped logger. Use this for safety-net logging (panics, critical errors) that must always fire regardless of dev mode. For dev-only output, use Warn or Debug instead.
func Reset ¶
func Reset()
Reset disables dev mode and clears the logger. Intended for tests that need to verify behaviour with dev mode off after another test has enabled it.
func SetLogger ¶
SetLogger configures the logger for all tether log output. When not called, the process-wide slog default is used as a fallback. Called once during handler initialisation.
Types ¶
This section is empty.