Created
November 4, 2010 19:11
-
-
Save nfo/662986 to your computer and use it in GitHub Desktop.
Prints all the sent HTTP queries, with the headers and data.
This file contains 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
Riak::Client::CurbBackend.class_eval do | |
private | |
def perform_with_logs(method, uri, headers, expect, data=nil) | |
puts "\e[31m#{method.upcase} #{uri}\e[0m" | |
puts "\t\e[33m#{headers}\e[0m" | |
# puts "\t\e[36m#{expect}\e[0m" | |
puts "\t\e[34m#{data}\e[0m" if data | |
# puts "\t\e[37m#{caller.last}\e[0m" | |
puts | |
perform_without_logs(method, uri, headers, expect, data) | |
end | |
alias_method_chain :perform, :logs | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment