Skip to content

expede/inspector_gadget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InspectorGadget

Helpers for debugging & inspecting code flow

Build Status Inline docs Deps Status hex.pm version API Docs license

Quick Start

def deps do
  [{:inspector_gadget, "~> 0.2.0"}]
end

Summary

Inspect Flow

import InspectorGadget
1
|> inspect_flow
|> fn x -> x + 1 end.()
|> fn y -> y * 100 end.()
|> inspect_flow
#=> 13:34:21.997 [info]  inspect_flow: 1
#=> 13:34:21.997 [info]  inspect_flow: 200

Overloaded Pipe

use InspectorGadget.Pipe

1
|> fn x -> x + b end.()
|> fn y -> y * 100 end.()
|> inspect
#=> 13:42:24.250 [info]  1 |> fn(x) = 2
#=> 13:42:24.250 [info]  2 |> fn(y) = 200
#=> 13:42:24.250 [info]  200 |> inspect = "200"

Note that this prints in the order of evaluation, so nested expressions are expected occur in a different sequence than the code

1
|> fn(x, y) -> x + y end.(
  6 |> fn z -> z * 10 end.()
)
#=> 13:44:02.649 [info]  6 |> fn(z) = 60
#=> 13:44:02.649 [info]  1 |> fn(x, y) = 61

About

Helpers for debugging & inspecting code flow

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages