locopati
Unicode output from the debugger
I was using the Erlang trace debugger to see how my string parsing code was being called. The strings are Unicode and so the output was like this…
(<0.101.0>) returned from ‘Elixir.Tinker’:handle/2 → [<<226,191,178>>,
[<<230,173,162>>,
<<232,135,170>>,
<<229,183,179>>,
<<229,133,171>>,
<<229,164,130>>]]
I ran iex --werl but that didn’t affect the debug output. Is it possible to make the Erlang debugger output Unicode strings so that they’re readable, rather than as bitstrings?
thanks
Most Liked
josevalim
The Adopting Elixir book has a chapter on production tools and a section on :dbg, here is the example we use:
iex> fun = fn _, 100 -> :dbg.stop_clear(); msg, n -> IO.inspect(msg) && n + 1 end
iex> :dbg.tracer(:process, {fun, 0})
josevalim
Which debugging are you using? :dbg? :sys? Note they usually allow you to pass a handler, so you can pass your own handler instead of relying on the default one.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









