stacky
Types
pub type ErlangFileName {
ErlangFileName(String)
}
Constructors
-
ErlangFileName(String)
pub type ErlangLineNumber {
ErlangLineNumber(Int)
}
Constructors
-
ErlangLineNumber(Int)
pub type ErlangModuleName {
ErlangModuleName(String)
}
Constructors
-
ErlangModuleName(String)
pub type FunctionArity {
FunctionArity(Int)
}
Constructors
-
FunctionArity(Int)
pub type FunctionName {
FunctionName(String)
}
Constructors
-
FunctionName(String)
pub type StackFrame {
StackFrame(
index: StackIndex,
erlang_module_name: ErlangModuleName,
function_name: FunctionName,
function_arity: FunctionArity,
erlang_file_name: ErlangFileName,
erlang_line_number: ErlangLineNumber,
)
}
Constructors
-
StackFrame( index: StackIndex, erlang_module_name: ErlangModuleName, function_name: FunctionName, function_arity: FunctionArity, erlang_file_name: ErlangFileName, erlang_line_number: ErlangLineNumber, )
pub type StackIndex {
StackIndex(Int)
}
Constructors
-
StackIndex(Int)
pub type StackTrace {
StackTrace(List(StackFrame))
}
Constructors
-
StackTrace(List(StackFrame))
Functions
pub fn erlang_file_name(stack_frame: StackFrame) -> String
Gets the erlang file name of the stack frame.
pub fn erlang_line_number(stack_frame: StackFrame) -> Int
Gets the ang erlline number of the stack frame.
pub fn erlang_module_name(stack_frame: StackFrame) -> String
Gets the erlang module name of the stack frame.
pub fn frame(stacktrace: StackTrace, index: Int) -> StackFrame
Gets the stack frame at the given list index.
Latest stack frame is at index 0. The StackFrame itself has an inverse index field that represents the index of the frame within the stack.
pub fn frame_to_string(stack_frame: StackFrame) -> String
Converts a stack frame to a string.
pub fn function_arity(stack_frame: StackFrame) -> Int
Gets the function arity of the stack frame.
pub fn function_name(stack_frame: StackFrame) -> String
Gets the function name of the stack frame.
pub fn gleam_module_name(stack_frame: StackFrame) -> String
Gets the potential gleam module name from the erlang source file name from the stack frame.
pub fn main() -> Nil
This is a library and the main function exists as a placeholder if called as a function from the command line.
pub fn print_frame_with(
stack_frame: StackFrame,
context c: a,
) -> Nil
Print a stack frame with context.
pub fn print_trace_with(
stack_trace: StackTrace,
context c: a,
) -> Nil
Print a stack trace with context.
pub fn stack_index(stack_frame: StackFrame) -> Int
Gets the stack index within its parent stack frame.
pub fn trace_to_string(stack_frame: StackTrace) -> String
Converts a stack trace to a string.