Packages

Erlang grab bag of useful functions. It should have been called swiss army knife but katanas are deadlier

Current section

Files

Jump to
katana src ktn_debug.erl
Raw

src/ktn_debug.erl

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% ktn_debug: functions useful for debugging
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-module(ktn_debug).
-export(
[ ppst/0
, ppst/1
]).
-spec ppst() ->
[any()].
ppst() ->
ppst(erlang:get_stacktrace()).
-spec ppst([any()]) ->
[any()].
ppst(StackTrace) ->
F =
fun({_Module, Function, Arity, Props}) ->
File = proplists:get_value(file, Props),
Line = proplists:get_value(line, Props),
io_lib:format("\t~s:~p:~p/~p~n", [File, Line, Function, Arity])
end,
lists:flatten(["\n", lists:map(F, StackTrace), "\n"]).