lib/airbrake.rb in airbrake-3.1.10 vs lib/airbrake.rb in airbrake-3.1.11

- old
+ new

@@ -17,10 +17,11 @@ require 'airbrake/version' require 'airbrake/configuration' require 'airbrake/notice' require 'airbrake/sender' +require 'airbrake/response' require 'airbrake/backtrace' require 'airbrake/rack' require 'airbrake/sinatra' require 'airbrake/user_informer' @@ -49,11 +50,11 @@ write_verbose_log("Environment Info: #{environment_info}") end # Prints out the response body from Airbrake for debugging help def report_response_body(response) - write_verbose_log("Response from Airbrake: \n#{response}") + write_verbose_log("Response from Airbrake: \n#{Response.pretty_format(response)}") end # Prints out the details about the notice that wasn't sent to server def report_notice(notice) write_verbose_log("Notice details: \n#{notice}") @@ -83,10 +84,15 @@ # config.api_key = '1234567890abcdef' # config.secure = false # end def configure(silent = false) yield(configuration) - self.sender = Sender.new(configuration) + self.sender = if configuration.test_mode? + CollectingSender.new(configuration) + else + Sender.new(configuration) + end + report_ready unless silent self.sender end # The configuration object.