Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sija/backtracer.cr
Crystal shard aiming to assist with parsing backtraces into a structured form.
https://github.com/sija/backtracer.cr
crystal parser stacktrace
Last synced: 29 days ago
JSON representation
Crystal shard aiming to assist with parsing backtraces into a structured form.
- Host: GitHub
- URL: https://github.com/sija/backtracer.cr
- Owner: Sija
- License: mit
- Created: 2020-12-27T16:05:34.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-12T15:39:03.000Z (about 1 year ago)
- Last Synced: 2024-08-04T01:05:19.343Z (3 months ago)
- Topics: crystal, parser, stacktrace
- Language: Crystal
- Homepage:
- Size: 37.1 KB
- Stars: 15
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# backtracer.cr [![CI](https://github.com/Sija/backtracer.cr/actions/workflows/ci.yml/badge.svg)](https://github.com/Sija/backtracer.cr/actions/workflows/ci.yml) [![Releases](https://img.shields.io/github/release/Sija/backtracer.cr.svg)](https://github.com/Sija/backtracer.cr/releases) [![License](https://img.shields.io/github/license/Sija/backtracer.cr.svg)](https://github.com/Sija/backtracer.cr/blob/master/LICENSE)
Crystal shard aiming to assist with parsing backtraces into a structured form.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
backtracer:
github: Sija/backtracer.cr
```2. Run `shards install`
## Usage
```crystal
require "backtracer"def foo
raise "bang!"
enddef bar
foo
enddef baz
bar
endbegin
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
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [@Sija](https://github.com/Sija) Sijawusz Pur Rahnama - creator and maintainer