Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from timting/master

Adding Logging
  • Loading branch information...
commit e11c445f5e95e4fa4371063e016f5c0013007e0b 2 parents c8e6239 + 760cba1
@lyleunderwood authored
View
2  lib/rails3-amf/request_parser.rb
@@ -25,6 +25,8 @@ def call env
if env['rails3amf.response'].constructed?
@logger.info "Sending back AMF"
response = env['rails3amf.response'].to_s
+
+ @logger.info "Response: #{response}"
return [200, {"Content-Type" => Mime::AMF.to_s, 'Content-Length' => response.length.to_s}, [response]]
else
return result
View
3  lib/rails3-amf/request_processor.rb
@@ -15,6 +15,7 @@ def initialize app, config={}, logger=nil
def call env
return @app.call(env) unless env['rails3amf.response']
+ @logger.info "AMF request detected: processing"
# Handle each method call
req = env['rails3amf.request']
res = env['rails3amf.response']
@@ -45,10 +46,12 @@ def handle_method method, args, env
params = build_params(controller_name, method_name, args)
env['rails3amf.params'] = params.merge(:controller => controller_name.sub(/Controller$/, '').downcase.to_sym)
req.params.merge!(params)
+ @logger.info "Rack request created"
# Run it
con = controller.new
res = con.dispatch(method_name, req)
+ @logger.info "Rack request run"
return con.amf_response
end
Please sign in to comment.
Something went wrong with that request. Please try again.