Documentation
¶
Overview ¶
Package debug provides the SMPLKIT_DEBUG diagnostic facility. It is an internal package and must not be imported by external packages.
Set SMPLKIT_DEBUG=1 (or "true" / "yes") to enable verbose output to stderr. All other values (including unset) disable output. The environment variable is read once at package init time and cached; changes after startup are not observed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
Debug writes a single diagnostic line to stderr when debug output is enabled. It is a no-op when disabled and is safe to call from any goroutine.
Output format: [smplkit:{subsystem}] {RFC3339Nano timestamp} {message}\n
func Enable ¶
func Enable()
Enable activates debug output regardless of the SMPLKIT_DEBUG env var. It is called by NewClient when debug=true is resolved from the config file or the Config struct, and may also be called directly in tests.
func SetEnabled ¶ added in v3.0.127
func SetEnabled(v bool)
SetEnabled sets the debug-output state explicitly. Used by tests to restore the process-global flag after a Config{Debug: true} client is constructed, so debug output does not leak into unrelated tests.
Types ¶
This section is empty.