Tracing of Elixir and Erlang functions.

Wraps Recon's :recon_trace, adding native Elixir formatting and macros for creating traces.

Summary

Functions

Traces calls, return values and exceptions from the function call template given as an argument.

Traces on the function patterns given as an argument.

Functions

call(mfa, opts)

(macro)

Traces calls, return values and exceptions from the function call template given as an argument.

Examples

Trace calls to &String.starts_with?/2 and print the first two events:

iex> Tap.call(String.starts_with?(_, _), 2)
1

Trace calls to &String.starts_with?/2 when the second argument is "b" and print the first event:

iex> Tap.call(String.starts_with?(_, "b"), 1)
1

calls(tspecs, opts)

Traces on the function patterns given as an argument.

Examples

Trace calls (but not return values) to &String.trim with any number of arguments and print the first ten events:

iex> Tap.calls([{String, :trim, :_}], max: 10)
2

Trace calls and return values from &String.trim/2 and print the first ten events:

iex> Tap.calls([{String, :trim, {2, :return}}], max: 10)
2

format(event)