ZenWebsocket.Debug (ZenWebsocket v0.4.2)

Copy Markdown View Source

Conditional debug logging for ZenWebsocket.

Provides debug logging that only outputs when debug: true is set in config. This keeps library output quiet by default while allowing verbose logging when troubleshooting connection issues.

Summary

Functions

Log a debug message if debug mode is enabled in the config.

Functions

log(config, message)

@spec log(ZenWebsocket.Config.t(), String.t()) :: :ok

Log a debug message if debug mode is enabled in the config.

Always pass the Config struct directly - this is the canonical holder of the debug flag.

Examples

ZenWebsocket.Debug.log(config, "Connection established")
ZenWebsocket.Debug.log(state.config, "Message received")