Packages

BEAM stack trace in Gleam: a stack trace of stack frames with module name, function name, arity, file name and line number.

Current section

Files

Jump to
stacky src stacky@internal@examples@example_2.erl
Raw

src/stacky@internal@examples@example_2.erl

-module(stacky@internal@examples@example_2).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([main/0]).
-spec main() -> stacky:stack_trace().
main() ->
Stacktrace = stacky:trace(),
gleam@io:print(<<"\n"/utf8>>),
gleam@io:println(<<"Trace to string:"/utf8>>),
_pipe = Stacktrace,
stacky:print_trace(_pipe),
gleam@io:print(<<"\n"/utf8>>),
gleam@io:println(<<"Frame:"/utf8>>),
Stackframe = begin
_pipe@1 = Stacktrace,
_pipe@2 = stacky:frame(_pipe@1, 0),
pprint:debug(_pipe@2)
end,
gleam@io:print(<<"\n"/utf8>>),
gleam@io:print(<<"Qualified module name: "/utf8>>),
_pipe@3 = Stackframe,
_pipe@4 = stacky:qualified_module_name(_pipe@3),
gleam@io:println(_pipe@4),
gleam@io:print(<<"\n"/utf8>>),
gleam@io:println(<<"Frame with context:"/utf8>>),
_pipe@5 = Stackframe,
stacky:print_frame_with(_pipe@5, {<<"my_context"/utf8>>}),
gleam@io:print(<<"\n"/utf8>>),
gleam@io:println(<<"Internal stack frame:"/utf8>>),
_pipe@6 = Stacktrace,
pprint:debug(_pipe@6).