Ehelper (Ehelper v0.2.7)
View SourceElixir helpers
Summary
Functions
Get current dbg backend
iex --dbg pry config :elixir, :dbg_callback, {MyMod, :debug_fun, [:stdio]} Application.put_env(:elixir, :dbg_callback, {Macro, :dbg, []}) if config.pry do Application.put_env(:elixir, :dbg_callback, {IEx.Pry, :dbg, []}) end
Test by by dbg with pry
$> iex -S mix
iex> break! H, :dbg_demo, 0
iex> H.dbg_demo # n to next
iex> break! URI, :parse, 1
iex> break! URI, :parse, 1
or break! URI.parse/1 or break! URI.parse("https" <> , )
- iex> H.dbg_demo Break reached: URI.parse/1 (/home/runner/work/elixir/elixir/lib/elixir/lib/uri.ex:792)
Hi test
Ping-pong test
try dbg pry
iex -S mix test test/lab/func_test.exs:5 --trace
debugging
- https://hexdocs.pm/elixir/debugging.html dbg opts
- https://hexdocs.pm/elixir/Inspect.Opts.html#t:new_opt/0
#iex> 123 |> dbg(base: :binary) #iex> # 123 #=> 0b1111011