Liberator.Trace (liberator v2.0.0) View Source

Decision tracing functions.

Link to this section Summary

Functions

Get the log of all decisions made on the given conn.

Get a list of tuples for the x-liberator-trace header, based on the given trace.

Log a message containing the given trace, along with its request path and optional request ID.

Link to this section Functions

Link to this function

get_trace(conn)

View Source (since 1.1)

Get the log of all decisions made on the given conn.

The trace is a list of maps, each map corresponding to one call to a decision function. Each map has the following keys:

  • :step: the name of the function that was executed, or the atoms :start or :stop
  • :result: the value the function returned
  • :timestamp: the time the function was called
  • :duration: how long the call took, in native time units
Link to this function

headers(trace)

View Source (since 1.3)

Get a list of tuples for the x-liberator-trace header, based on the given trace.

Link to this function

log(trace, request_path, request_id \\ nil)

View Source (since 1.3)

Log a message containing the given trace, along with its request path and optional request ID.