Question:
I’m pretty talented at typing:IO.inspect(something, label: something_else, limit: :infinity)
Now I’m wondering if there’s a way via configuration to always do the
limit: :infinity
part w/o having to type it in every time.Is this even a thing?
Answer:
You can override the default inspect behaviour by settingInspect.Opts.default_inspect_fun/1
:Set this option with care as it will change how all values in the system are inspected. The main use of this functionality is to provide an entry point to filter inspected values, in order for entities to comply with rules and legislations on data security and data privacy.
As you can see, it has overridden how iex displays the results, which also uses the
Inspect
protocol, in addition to the options passed to IO.inspect
:.iex.exs
file:If you have better answer, please add a comment about this, thank you!