deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 1/3] Make DC compatible with webrick
Date Thu, 18 Oct 2012 19:43:12 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/sinatra/rack_logger.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/lib/sinatra/rack_logger.rb b/server/lib/sinatra/rack_logger.rb
index 677444b..02bbf2a 100644
--- a/server/lib/sinatra/rack_logger.rb
+++ b/server/lib/sinatra/rack_logger.rb
@@ -89,7 +89,8 @@ module Rack
       params = env['rack.request.form_hash'].nil? ? '' : ' '+env['rack.request.form_hash'].to_json
 
       logger = @logger || env['rack.errors']
-      logger << VERBOSE_FORMAT % [
+      logger_method = logger.respond_to?(:info) ? :info : :puts
+      logger.send logger_method, VERBOSE_FORMAT % [
         env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"] || "-",
         env["REMOTE_USER"] || "-",
         now.strftime("%d/%b/%Y %H:%M:%S"),
@@ -110,7 +111,8 @@ module Rack
       length = extract_content_length(header)
 
       logger = @logger || env['rack.errors']
-      logger << FORMAT % [
+      logger_method = logger.respond_to?(:info) ? :info : :puts
+      logger.send logger_method, FORMAT % [
         env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"] || "-",
         env["REMOTE_USER"] || "-",
         now.strftime("%d/%b/%Y %H:%M:%S"),
-- 
1.7.12.1


Mime
View raw message