diff options
author | Ripta Pasay <ripta@hogan.home.r8y.org> | 2008-07-12 18:54:24 -0400 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-17 01:33:44 +0100 |
commit | f7fdbae770275ccbc277c42287b9783cb00fa9fa (patch) | |
tree | e24232610d6261421a7a1f9e353c817f1f5b7b30 /actionpack | |
parent | 396f9df8916b71f83aad8d56559cf55fc8501679 (diff) | |
download | rails-f7fdbae770275ccbc277c42287b9783cb00fa9fa.tar.gz rails-f7fdbae770275ccbc277c42287b9783cb00fa9fa.tar.bz2 rails-f7fdbae770275ccbc277c42287b9783cb00fa9fa.zip |
Use fully-qualified controller name when logging. [#600 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack')
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/base_test.rb | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index df94f78f18..c56812c2d9 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -1155,7 +1155,7 @@ module ActionController #:nodoc: def log_processing if logger && logger.info? - logger.info "\n\nProcessing #{controller_class_name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]" + logger.info "\n\nProcessing #{self.class.name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]" logger.info " Session ID: #{@_session.session_id}" if @_session and @_session.respond_to?(:session_id) logger.info " Parameters: #{respond_to?(:filter_parameters) ? filter_parameters(params).inspect : params.inspect}" end diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index 34c0200fe8..d49cc2a9aa 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -7,6 +7,7 @@ module Submodule end class ContainedNonEmptyController < ActionController::Base def public_action + render :nothing => true end hide_action :hidden_action @@ -105,6 +106,18 @@ end class PerformActionTest < Test::Unit::TestCase + class MockLogger + attr_reader :logged + + def initialize + @logged = [] + end + + def method_missing(method, *args) + @logged << args.first + end + end + def use_controller(controller_class) @controller = controller_class.new @@ -142,6 +155,13 @@ class PerformActionTest < Test::Unit::TestCase get :another_hidden_action assert_response 404 end + + def test_namespaced_action_should_log_module_name + use_controller Submodule::ContainedNonEmptyController + @controller.logger = MockLogger.new + get :public_action + assert_match /Processing\sSubmodule::ContainedNonEmptyController#public_action/, @controller.logger.logged[1] + end end class DefaultUrlOptionsTest < Test::Unit::TestCase |