public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Use fully-qualified controller name when logging. [#600 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Ripta Pasay (author)
Sat Jul 12 15:54:24 -0700 2008
Tarmo Tänav (committer)
Sun Aug 24 09:26:40 -0700 2008
commit  6fbd6c0a009e4848b9cd2e0a055b8ecdb867049f
tree    e51b5c601f266605246bb8008c8345f5d1039dc9
parent  50c73c2dfd0d5eb880426e7bc385bcee004ffe3e
...
1150
1151
1152
1153
 
1154
1155
1156
...
1150
1151
1152
 
1153
1154
1155
1156
0
@@ -1150,7 +1150,7 @@ module ActionController #:nodoc:
0
 
0
       def log_processing
0
         if logger && logger.info?
0
-          logger.info "\n\nProcessing #{controller_class_name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]"
0
+          logger.info "\n\nProcessing #{self.class.name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]"
0
           logger.info "  Session ID: #{@_session.session_id}" if @_session and @_session.respond_to?(:session_id)
0
           logger.info "  Parameters: #{respond_to?(:filter_parameters) ? filter_parameters(params).inspect : params.inspect}"
0
         end
...
7
8
9
 
10
11
12
...
105
106
107
 
 
 
 
 
 
 
 
 
 
 
 
108
109
110
...
142
143
144
 
 
 
 
 
 
 
145
146
147
...
7
8
9
10
11
12
13
...
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
...
155
156
157
158
159
160
161
162
163
164
165
166
167
0
@@ -7,6 +7,7 @@ module Submodule
0
   end
0
   class ContainedNonEmptyController < ActionController::Base
0
     def public_action
0
+      render :nothing => true
0
     end
0
     
0
     hide_action :hidden_action
0
@@ -105,6 +106,18 @@ end
0
 
0
 
0
 class PerformActionTest < Test::Unit::TestCase
0
+  class MockLogger
0
+    attr_reader :logged
0
+
0
+    def initialize
0
+      @logged = []
0
+    end
0
+
0
+    def method_missing(method, *args)
0
+      @logged << args.first
0
+    end
0
+  end
0
+
0
   def use_controller(controller_class)
0
     @controller = controller_class.new
0
 
0
@@ -142,6 +155,13 @@ class PerformActionTest < Test::Unit::TestCase
0
     get :another_hidden_action
0
     assert_response 404
0
   end
0
+
0
+  def test_namespaced_action_should_log_module_name
0
+    use_controller Submodule::ContainedNonEmptyController
0
+    @controller.logger = MockLogger.new
0
+    get :public_action
0
+    assert_match /Processing\sSubmodule::ContainedNonEmptyController#public_action/, @controller.logger.logged[1]
0
+  end
0
 end
0
 
0
 class DefaultUrlOptionsTest < Test::Unit::TestCase

Comments