Skip to content

Instantly share code, notes, and snippets.

@Snake-Sanders
Last active April 23, 2023 18:07
Show Gist options
  • Save Snake-Sanders/82c715accbfea0522e3ba6f8294dd3b7 to your computer and use it in GitHub Desktop.
Save Snake-Sanders/82c715accbfea0522e3ba6f8294dd3b7 to your computer and use it in GitHub Desktop.
Elixir env settings

Reduce the debug level of the terminal

  • /config/dev.exs

config :logger, level: :info

Debug Iex using Ecto queries

  • .iex.exs

    Logger.configure(level: :info)

    import Ecto.Query

Debug with inspect

  • add a lable to the debug data

    IO.inspect(variable, label: "The content)

  • add format to the content

    IO.inspect(variable, pretty: true)

  • avoid truncated data

    IO.inspect(variable, limit: :infinity)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment