Iodata print elixir term as elixir syntax

ReconTrace (taking one example) is a trading library (like all of them) which provides the ability to specify a formatting function which takes an argument tuple and does something with it rather than just tracing to the console.

I’d like to write a formatter that sends the call arguments to a file in a format like this (erlang terms loadable by :file.consult)

Can anyone suggest a good way of formatting that conversats them to a string or iolist in this erlang term format with the least amount of effort?

Just use Erlang pretty printer:

:io_lib.format("~p", [data])