Forum: Ruby [ANN] ruby backtracer (quality screen output) updated

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2009-05-01 13:42
Pleased to announce a new version of ruby_backtracer.

Here's the readme.

ruby_backtracer: a library to output higher quality backtraces if an
unhandled exception is raised

running given script examples/crash.rb used to output:
examples>ruby crash.rb
crash.rb:2:in `go2': unhandled exception
        from crash.rb:6:in `go'
        from crash.rb:9

now outputs:
examples>ruby -r../backtrace_with_code_and_locals crash.rb

unhandled exception: crash.rb:2:   raise
        locals: {"a"=>"3", "b"=>55}
        crash.rb:1 go2(a=>3, b=>55)
                locals: {"a"=>"3", "b"=>55}
        crash.rb:5 go(a=>3)
                locals: {"a"=>"3"}

Now wasn't that prettier?

There are several other tracing options provided, if you don't want as
much output, or want more speed.  Specify which by script name.

ex: backtrace_nothing_swallowed.rb outputs the same as the default
exception output, except it doesn't have the
...skip 24 lines...
line in the middle (also no speed slowdown, and no local variables

Try them out by running test_all.rb in the examples folder, or eyeball
the example output files in examples/example_output*

Note: some options depends on ruby-debug [MRI] gem, some don't.

To install clone from github, above, then -rscriptname.

related projects: unroller,,
liveconsole, ruby-debug

This topic is locked and can not be replied to.