Hephaestus.Telemetry.LogHandler (hephaestus v0.3.1)

Copy Markdown View Source

A structured Logger handler that attaches to Hephaestus telemetry events and produces human-readable, grep-friendly log output.

Opt-in via attach/1:

Hephaestus.Telemetry.LogHandler.attach()

Options

  • :level — map of event name to log level override, e.g. %{[:hephaestus, :step, :stop] => :debug}

  • :events — list of event names to handle (default: all from Hephaestus.Telemetry.events/0)

Summary

Functions

Attaches the log handler to Hephaestus telemetry events.

Detaches the log handler from Hephaestus telemetry events.

Functions

attach(opts \\ [])

@spec attach(keyword()) :: :ok | {:error, :already_exists}

Attaches the log handler to Hephaestus telemetry events.

Returns :ok on success, or {:error, :already_exists} if already attached.

Options

  • :level — map of event name to log level override
  • :events — list of event names to subscribe to (default: all)

detach()

@spec detach() :: :ok | {:error, :not_found}

Detaches the log handler from Hephaestus telemetry events.

Returns :ok on success, or {:error, :not_found} if not currently attached.