Permalink
Browse files

note the screencast

  • Loading branch information...
1 parent fa5acc0 commit d41c6809d1d6a8268b3ebeb9e09fa929a720a17f @rdp committed Nov 12, 2009
Showing with 19 additions and 11 deletions.
  1. +12 −8 README
  2. +7 −3 lib/backtracer_tracer_exception_creation.rb
View
@@ -5,7 +5,7 @@ If you've ever seen
...24 levels...
and disliked it, this is the gem for you.
-If you've ever wished an exception printout would display the code of the lines in a backtrace (a la Python), this is for you.
+If you've ever wished the exception trace would display the code of each line (a la Python), then this gem is for you.
It displays the full back trace (no ...'s), along with the code from each line! It can even display local variables at each level of the call stack, if desired.
@@ -30,11 +30,11 @@ crash.rb:10
go '3'
-(Note--has the code lines, and if there had been ...'s, would have ovecome them).
+(Now has the code lines, and if there had been ...'s, would have ovecome them).
-or the --locals option
+or use the --locals option
-$backtracer --locals crash.rb
+$ backtracer --locals crash.rb
unhandled exception: crash.rb:2: raise
locals: {"a"=>"3", "b"=>55}
@@ -44,22 +44,26 @@ unhandled exception: crash.rb:2: raise
crash.rb:5 go(a=>3)
locals: {"a"=>"3"}
-(displays locals, parameters kind of)
+(displays locals, parameters as current value)
-Also included is a --ping option, which periodically dumps current threads' backtrace(s)--quite useful for profiling to see where you code is spending a lot of its time (thanks xray gem!). There is also an option that will print out thread dumps whenever you hit ctrl+c.
+Also included are several other options. One is --ping, which periodically dumps current threads' backtrace(s) (quite useful for profiling to see where you code is spending a lot of its time (thanks xray gem!)). There is also an option that will print out thread dumps whenever you hit ctrl+c.
To see all possible backtrace options run
$ backtracer -h
or
$ backtracer --help
-
-More example outputs:
+More examples can be found here:
http://github.com/rdp/backtracer/blob/master/examples/example_test_all_output
http://github.com/rdp/backtracer/blob/master/examples/example_test_large_output
http://github.com/rdp/backtracer/blob/master/examples/pinger_example
+== Screencast ==
+
+http://www.rubypulse.com/episode-0.18_backtracer.html
+[thanks aaalex!]
+
== Installation ==
== 1.8.x ==
@@ -5,13 +5,17 @@ class Demo < EventHook
def self.process(*args)
# args => [64, #<RuntimeError: hello>, :initialize, Exception]
- if args[1].is_a? Exception
- puts args.inspect
+ begin
+ if args[1].is_a? Exception
+ puts args.inspect
+ end
+ rescue
+ # fantastically, this check fails within rails at times
end
end
end
Demo.start_hook
+# TODO 1.9 compat
#set_trace_func proc {|*args| puts args.inspect }
-raise 'hello'

0 comments on commit d41c680

Please sign in to comment.