Last active
May 2, 2016 00:47
-
-
Save NullVoxPopuli/7159fd6701ef25df2fa4563979218659 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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