Created
March 19, 2009 13:40
-
-
Save febeling/81819 to your computer and use it in GitHub Desktop.
Macros for displaying stacktrace information in erlang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-define(callstack(), | |
try throw(generate_stack) | |
catch | |
throw:generate_stack -> | |
erlang:get_stacktrace() | |
end). | |
-define(printstack(), | |
PrintFrame = fun({Mod, Fun, Ari}) -> | |
io:format(" at ~w:~w/~w~n", [Mod, Fun, Ari]) | |
end, | |
lists:map(PrintFrame, ?callstack())). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment