Untangle - logging and inspecting with code location information

Untangle provides alternatives for IO.inspect and the macros in Elixir’s Logger to output code location information. It also provides a polyfill for calls to dbg which was introduced in Elixir 1.14 (it won’t give you the IEx integration but will show an ouput in console, which is handy if you want to start using dbg in codebases where not everyone is on the latest Elixir).

Code: GitHub - bonfire-networks/untangle: Logging and inspecting with location information
Hex: untangle | Hex
Read me: Untangle — untangle v0.1.0
Module Docs: Untangle — untangle v0.1.0

4 Likes

New addition is the ability to log the execution time of functions.

You decorate a function like this:

use Untangle

@decorate time()
def foo(), do: :stuff

and will log something like [info] Time to run MyModule.foo/0: 1 ms

1 Like

Would you consider making the timing granularity in microseconds?

Ah yes, timing is done in micoseconds but converted to milliseconds in the log message. I’d welcome a PR to only use milliseconds if higher than 1 ms.