mirror of
https://gitea.invidious.io/iv-org/shard-backtracer.cr.git
synced 2024-08-15 00:53:13 +00:00
No description
d461ca301b
Bump ameba version to ~> 1.5.0 |
||
---|---|---|
.github/workflows | ||
spec | ||
src | ||
.ameba.yml | ||
.editorconfig | ||
.gitignore | ||
LICENSE | ||
README.md | ||
shard.yml |
backtracer.cr
Crystal shard aiming to assist with parsing backtraces into a structured form.
Installation
-
Add the dependency to your
shard.yml
:dependencies: backtracer: github: Sija/backtracer.cr
-
Run
shards install
Usage
require "backtracer"
def foo
raise "bang!"
end
def bar
foo
end
def baz
bar
end
begin
baz
rescue ex
backtrace = Backtracer.parse(ex.backtrace)
# Prints
#
# `foo` at foo.cr:4:3
# `bar` at foo.cr:8:3
# `baz` at foo.cr:12:3
# ...
backtrace.frames.each do |frame|
puts frame
end
end
Contributing
- Fork it (https://github.com/Sija/backtracer.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- @Sija Sijawusz Pur Rahnama - creator and maintainer