• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Set limit: :infinity as a default elixir

Resolved: Set limit: :infinity as a default elixir

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

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 setting Inspect.Opts.default_inspect_fun/1:
Before:
After:
However, this comes with caveats in the docs:

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:
If you only want to configure iex, not the entire Inspect protocol, you can put this in your .iex.exs file:

If you have better answer, please add a comment about this, thank you!

io
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How do I use SetWindowText with Unicode in Win32 using PowerShell?

01/04/2023

Resolved: Shopware 400 Status Error “This value is too long. It should have 255 character or less.” When I Try Updating Database Table

01/04/2023

Resolved: Using AWK to count multiple patterns in a file

01/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.