Because Erlang's tracing is awesome and doing compile time debugging sucks!
Description
Tap enables tracing of Elixir and Erlang functions in a intuitive and safe way.
iex(1)> require Tap
Tap
iex(2)> Tap.call(String.trim(_, _), max: 4)
2
iex(3)> String.trim("test", "t")
"es"
11:51:36.370105 #PID<0.198.0> String.trim("test", "t")
11:51:36.377859 #PID<0.198.0> String.trim/2 --> "es"
iex(4)> String.trim("test", ?t)
11:51:44.140333 #PID<0.198.0> String.trim("test", 116)
11:51:44.140559 #PID<0.198.0> String.trim/2 ** (FunctionClauseError) no function clause matches
Recon tracer rate limit tripped.
** (FunctionClauseError) no function clause matching in String.trim/2
The following arguments were given to String.trim/2:
# 1
"test"
# 2
116
Attempted function clauses (showing 1 out of 1):
def trim(string, to_trim) when is_binary(string) and is_binary(to_trim)
(elixir 1.20.4) lib/string.ex:1431: String.trim/2
iex:4: (file)
iex(4)>Tap wraps the excellent Recon library, adding native Elixir formatting and macros for creating traces in an intuitive way.
Releasing
- Run
mise run release:prepareto set the next version inmix.exsand regenerateCHANGELOG.md. The version is computed from the commits since the last release. To override it, pass an explicit version (e.g.mise run release:prepare 1.0.0). - Review the changes.
- Run
mise run release:pushto commit the release and push it tomain. CI publishes the package to Hex, tags the release, and creates a GitHub release once lint and tests pass.