LLMUtils.Logging (llm_utils v0.1.3)

Copy Markdown View Source

Toggleable structured logger for LLM calls.

Usage

LLMUtils.Logging.enable()
LLMUtils.Logging.log(:info, "message", provider: "openai")
LLMUtils.Logging.disable()

Override by passing a module with the same interface in Client options.

Note: Call require LLMUtils.Logging before using log/3 in modules that don't already require Logger.

Summary

Functions

Disable logging.

Enable logging.

Check if logging is enabled.

Log a message if logging is enabled.

Functions

disable()

@spec disable() :: :ok

Disable logging.

enable()

@spec enable() :: :ok

Enable logging.

enabled?()

@spec enabled?() :: boolean()

Check if logging is enabled.

log(level, message, metadata \\ [])

@spec log(Logger.level(), String.t(), keyword()) :: :ok

Log a message if logging is enabled.