Skip to content

Instantly share code, notes, and snippets.

@NullVoxPopuli
Last active May 2, 2016 00:47
Show Gist options
  • Save NullVoxPopuli/7159fd6701ef25df2fa4563979218659 to your computer and use it in GitHub Desktop.
Save NullVoxPopuli/7159fd6701ef25df2fa4563979218659 to your computer and use it in GitHub Desktop.
require 'awesome_print'
log_methods = [:perform, :dispatch_message]
set_trace_func proc {
|event, file, line, id, binding, classname|
if event == "call" #or event == "return"
if log_methods.include?(id)
printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
vars = binding.local_variables
vars.each do |variable|
puts "#{classname}##{id}\n\t#{variable} ="
ap eval(variable.to_s, binding)
end
end
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment