Created
February 7, 2013 02:39
-
-
Save jugyo/4727965 to your computer and use it in GitHub Desktop.
earthquake.gem plugin
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
Earthquake.once do | |
require 'webmock' | |
require 'logger' | |
logger = Logger.new(File.join(Earthquake.config[:dir], 'api.log')) | |
WebMock.allow_net_connect! | |
WebMock.after_request do |request, response| | |
logger.info "#{request.method.upcase} #{request.uri} #{request.body}" | |
logger.info response.status.join(' ') | |
logger.info response.body | |
logger.info response.headers.map {|key, val| "#{key}: #{val}" }.join("\n") | |
logger.info '-' * 80 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment