ReqLLM.Debug (ReqLLM v1.0.0)
View SourceCentralized debug logging for ReqLLM development and troubleshooting.
Provides helpers for emitting debug messages when the REQ_LLM_DEBUG environment
variable is set to "1", "true", "yes", or "on".
Usage
import ReqLLM.Debug, only: [dbug: 1, dbug: 2]
dbug("Simple message", component: :fixtures)
dbug(fn -> "Expensive #{calculation()}" end, component: :stream_server)All debug logs are tagged with req_llm: true metadata for filtering.
Summary
Functions
Macro alias for log/2 that can be imported for cleaner syntax.
Examples
import ReqLLM.Debug, only: [dbug: 2]
dbug("Message", component: :stream_server)
@spec enabled?() :: boolean()
Returns true if debug logging is enabled.
Checks Application config first, then falls back to environment variable.
Emit an info-level log message if debugging is enabled.
Accepts either a string or a zero-arity function for lazy evaluation. Additional metadata can be provided via keyword list.
Emit a debug-level log message if debugging is enabled.
Accepts either a string or a zero-arity function for lazy evaluation. Additional metadata can be provided via keyword list.
Examples
dbg("Starting operation")
dbg(fn -> "Result: #{expensive_operation()}" end, component: :fixtures)