lib/flexirest/logger.rb in flexirest-1.11.3 vs lib/flexirest/logger.rb in flexirest-1.12.0

- old
+ new

@@ -14,9 +14,17 @@ def self.reset! @logfile = nil @messages = [] end + def self.level + if defined?(Rails) && Rails.logger.present? + Rails.logger.level + else + 0 + end + end + def self.debug(message) if defined?(Rails) && Rails.logger.present? Rails.logger.debug(message) elsif @logfile if @logfile.is_a?(String)