Honeybadger.Utils (Honeybadger v0.24.0)

View Source

Assorted helper functions used through out the Honeybadger package.

Summary

Functions

Transform value into a consistently cased string representation

Concatenate a list of items with a dot separator.

Internally all modules are prefixed with Elixir. This function removes the Elixir prefix from the module when it is converted to a string.

Configurable data sanitization. This currently

Functions

canonicalize(val)

Transform value into a consistently cased string representation

Example

iex> Honeybadger.Utils.canonicalize(:User_SSN)
"user_ssn"

dotify(path)

Concatenate a list of items with a dot separator.

Example

iex> Honeybadger.Utils.dotify([:Honeybadger, :Utils])
"Honeybadger.Utils"

module_to_string(module)

Internally all modules are prefixed with Elixir. This function removes the Elixir prefix from the module when it is converted to a string.

Example

iex> Honeybadger.Utils.module_to_string(Honeybadger.Utils)
"Honeybadger.Utils"

rand_id(size \\ 16)

sanitize(value, opts \\ [])

Configurable data sanitization. This currently:

  • recursively truncates deep structures (to a depth of 20)
  • constrains large string values (to 64k)
  • filters out any map keys that might contain sensitive information.

Options:

  • :remove_filtered - When true, filtered keys will be removed instead of replaced with "[FILTERED]". Default: false