Callstacking is a rolling, checkpoint debugger for Rails. It records all of the critical method calls within your app, along with their important context (param/argument/return/local variable values).
You no longer need to debug with binding.pry
or puts
statements, as the entire callstack for a given request is captured.
Class method calls are labeled. Return values for those calls are denoted with ↳
Arguments for a method will be listed along with their calling values.
For method returns ↳, the final values of the local variables will be listed when you hover over the entry.
Subsequent calls within a method are visibly nested.
Checkpoint is a Rails engine that you mount within your Rails app.
Here's a sample debugging sessions recorded from a Jumpstart Rails based app I've been working on. This is a request for the main page ( https://smartk.id/ ).
Checkpoint Rails records all of the critical method calls within your app, along with their important context (param/argument/return/local variable values).
All in a rolling panel, so that you can debug your call chains from any point in the stack.
You'll never have to debug with puts
statements ever again.
Calls are visibly nested so that it's easy to see which calls are issued from which parent methods.
Add this line to your application's Gemfile:
gem "callstacking-rails"
And then execute:
$ bundle
When you open a page for your app, once the page has rendered, you will see an arrow on the right hand side.
Click the arrow, and observe the full callstack context.
The gem is available as open source under the terms of the MIT License.