LoggerJSON.JasonSafeFormatter (logger_json v4.3.0) View Source

Utilities for converting metadata into data structures that can be safely passed to Jason.encode!/1.

Link to this section Summary

Functions

Produces metadata that is "safe" for calling Jason.encode!/1 on without errors. This means that unexpected Logger metadata won't cause logging crashes.

Link to this section Functions

Specs

format(any()) :: any()

Produces metadata that is "safe" for calling Jason.encode!/1 on without errors. This means that unexpected Logger metadata won't cause logging crashes.

Current formatting is...

  • Maps: as is
  • Printable binaries: as is
  • Numbers: as is
  • Structs that don't implement Jason.Encoder: converted to maps
  • Tuples: converted to lists
  • Keyword lists: converted to Maps
  • everything else: inspected
Link to this function

jason_implemented?(data)

View Source