BeamConsole.ReasonSummary (beam_console v0.5.3)

Copy Markdown View Source

Converts process exit reasons into bounded, non-sensitive summaries.

Arbitrary binaries, lists, maps, PIDs, references, functions, and ports are described structurally rather than copied. This prevents raw application terms or credentials from entering recorder history.

Summary

Functions

Returns a categorized structural summary under a byte limit.

Types

category()

@type category() :: :normal | :shutdown | :killed | :missing | :connection | :error

t()

@type t() :: %BeamConsole.ReasonSummary{category: category(), text: String.t()}

Functions

sanitize(reason, options \\ [])

@spec sanitize(
  term(),
  keyword()
) :: t()

Returns a categorized structural summary under a byte limit.

Examples

iex> BeamConsole.ReasonSummary.sanitize(:normal)
%BeamConsole.ReasonSummary{category: :normal, text: "normal"}

iex> summary = BeamConsole.ReasonSummary.sanitize({:badmatch, "secret"})
iex> {summary.category, summary.text}
{:error, "{badmatch, binary(6 bytes)}"}