Trace exception local variables and args per frame

New configuration options and defaults
config.locals.enabled = off
config.locals.max_trace_frames = 100

Turned off by default because this may not be performant just yet!

  1. Stores each Ruby process' local vars and method arguments
  2. When gathering exception data, "replay" over each frame to get the variables for that frame's context
  3. Dump the cache and repeat
That's sort of what this branch does:
https://github.com/rollbar/rollbar-gem/tree/new_interface

That branch implements our "new" interface for the notifiers. It's mostly
done, just needs a bunch of testing if you want to take a look at it, Jon.


Cory Virok, @coryvirok <http://twitter.com/coryvirok>
Co-founder and CTO, Rollbar <http://rollbar.com/>

On Wed, Oct 1, 2014 at 2:27 AM, Jon <notifications@github.com> wrote:

> In lib/rollbar.rb:
>
> > +    }
> > +
> > +    # Method#parameters is unavailable in Ruby 1.8.7 and below
> > +    CAN_CHECK_METHOD_PARAMS = Method.method_defined? :parameters
> > +
> > +    def local_variables_struct
> > +      if CAN_CHECK_METHOD_PARAMS
> > +        { :locals => {}, :args => {} }
> > +      else
> > +        { :locals => {} }
> > +      end
> > +    end
> > +
> > +    def start_tracking_locals
> > +      reset_current_trace
> > +      set_trace_func proc { |event, file, line, id, binding, classname|
>
> This could be resolved if instead of having a Rollbar module doing all
> the stuff, the Rollbar methods just instanciate a Notifier object with
> all the logic that actually resides in the singleton Rollbar.
>
> This change will become Rollbar to be threadsafe.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/rollbar/rollbar-gem/pull/134/files#r18268616>.
>