backtracer

Shard aiming to assist with parsing backtraces into a structured form stacktrace parser
1.2.1 released

backtracer.cr Build Status Releases License

Crystal shard aiming to assist with parsing backtraces into a structured form.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      backtracer:
        github: Sija/backtracer.cr
    
  2. 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

  1. Fork it (https://github.com/Sija/backtracer.cr/fork)
  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 Sijawusz Pur Rahnama - creator and maintainer
backtracer:
  github: Sija/backtracer.cr
  version: ~> 1.2.1
License MIT
Crystal >= 0.35.0

Authors

Dependencies 0

Development Dependencies 1

  • ameba ~> 0.13.0
    {'github' => 'crystal-ameba/ameba', 'version' => '~> 0.13.0'}

Dependents 2

Last synced .
search fire star recently