lib/crash_log.rb in crashlog-1.0.5 vs lib/crash_log.rb in crashlog-1.0.6
- old
+ new
@@ -66,11 +66,10 @@
notify(exception, context) unless ignored?(exception)
end
# Print a message at the top of the applciation's logs to say we're ready.
def report_for_duty!
- self.reporter = CrashLog::Reporter.new(configuration)
application = reporter.announce
if application
info("Configured correctly and ready to handle exceptions for '#{application}'")
else
@@ -82,19 +81,21 @@
# required.
def configure(announce = false, &block)
if block_given?
yield(configuration)
- self.reporter = CrashLog::Reporter.new(configuration)
+ if live?
+ self.reporter = CrashLog::Reporter.new(configuration)
- if configuration.valid?
- if announce.eql?(true)
- report_for_duty!
- else
- debug("Configuration updated successfully")
+ if configuration.valid?
+ if announce.eql?(true)
+ report_for_duty!
+ else
+ debug("Configuration updated successfully")
+ end
+ elsif !configuration.invalid_keys.include?(:api_key)
+ error("Not configured correctly. Missing the following keys: #{configuration.invalid_keys.join(', ')}")
end
- elsif !configuration.invalid_keys.include?(:api_key)
- error("Not configured correctly. Missing the following keys: #{configuration.invalid_keys.join(', ')}")
end
end
configuration
end