Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inoas/stacky
Stacky ☆ BEAM stack trace in Gleam: a stack trace of stack frames with module name, function name, arity, file name and line numb
https://github.com/inoas/stacky
Last synced: 28 days ago
JSON representation
Stacky ☆ BEAM stack trace in Gleam: a stack trace of stack frames with module name, function name, arity, file name and line numb
- Host: GitHub
- URL: https://github.com/inoas/stacky
- Owner: inoas
- License: mpl-2.0
- Created: 2024-05-15T12:41:30.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-06T20:30:24.000Z (6 months ago)
- Last Synced: 2024-10-04T20:15:31.446Z (2 months ago)
- Language: Gleam
- Size: 52.7 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-gleam - stacky - [📚](https://hexdocs.pm/stacky/) - Stacky ☆ BEAM stack trace in Gleam (Packages / Logging and Monitoring)
README
# Stacky ☆ BEAM stack trace in Gleam
![Erlang-compatible](https://img.shields.io/badge/target-erlang-b83998)
![CI](https://github.com/inoas/stacky/actions/workflows/test.yml/badge.svg?branch=main)**A stack trace of stack frames with module name, function name, arity, file name and line number!**
## Installation
```shell
gleam add stacky
```## Usage
```gleam
let stacktrace = stacky.trace()io.print("\n")
io.println("Trace to string:")
stacktrace |> stacky.print_trace
io.print("\n")
io.println("Frame with context:")
stackframe |> stacky.print_frame_with(context: #("my_context"))
````stdout` example:
```plaintext
Trace to string:
# 06 main() of src/stacky/internal/examples/example_readme.gleam
in /SOME_PATH/stacky/build/dev/erlang/stacky/_gleam_artefacts/stacky@internal@examples@example_readme.erl:8
# 05 stacky@@main:run/1
in /SOME_PATH/stacky/build/dev/erlang/stacky/_gleam_artefacts/stacky@@main.erl:11
# 04 erl_eval:do_apply/7
in erl_eval.erl:746
# 03 init:start_it/1
# 02 init:start_em/1
# 01 init:do_boot/3Frame with context:
# 06 main() of src/stacky/internal/examples/example_readme.gleam
in /Users/leo/local-dev/gleam/stacky/build/dev/erlang/stacky/_gleam_artefacts/stacky@internal@examples@example_readme.erl:8
context: #("my_context")
```## Demos
```shell
gleam run --module stacky/internal/examples/example_1
gleam run --module stacky/internal/examples/example_2
gleam run --module stacky/internal/examples/example_3
```Further documentation can be found at .