lib/httpi.rb in httpi-0.7.9 vs lib/httpi.rb in httpi-0.8.0
- old
+ new
@@ -71,11 +71,11 @@
# end
module HTTPI
REQUEST_METHODS = [:get, :post, :head, :put, :delete]
- DEFAULT_LOG_LEVEL = :debug
+ DEFAULT_LOG_LEVEL = :warn
class << self
# Executes an HTTP GET request.
def get(request, adapter = nil)
@@ -152,11 +152,11 @@
# Sets the log level.
attr_writer :log_level
# Returns the log level. Defaults to :debug.
def log_level
- @log_level ||= :debug
+ @log_level ||= DEFAULT_LOG_LEVEL
end
# Logs given +messages+.
def log(*messages)
logger.send log_level, messages.join(" ") if log?
@@ -183,10 +183,10 @@
# <tt>Adapter.use</tt>) and yields an instance of the adapter to a given block.
def with_adapter(method, request, adapter)
adapter ||= Adapter.use
adapter, adapter_class = Adapter.find adapter
- HTTPI.log "HTTPI executes HTTP #{method.to_s.upcase} using the #{adapter} adapter"
+ HTTPI.logger.debug "HTTPI executes HTTP #{method.to_s.upcase} using the #{adapter} adapter"
yield adapter_class.new(request)
end
end
end