Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

'Redirected to' string in logs hash.to_s

#1984

I'm seeing this in the logs:

Redirected to actionlogincontrolleraccounturlified_namesite

As you can see, the location hash is being printed, but as a string (which isn't formatted properly till Ruby 1.9).

Perhaps add something like:

if RUBY_VERSION < '1.9'
  class Hash
    def to_s
      self.inspect
    end
  end
end

Or change the print to use .inspect.

Reported by Kieran P · February 16th, 2009 @ 04:36 AM

State: invalid
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Kieran P
    Kieran P

    diff --git a/vendor/rails/actionpack/lib/action_controller/base.rb b/vendor/rails/actionpack/lib/action_controller/base.rb

    index 36b80d5..ff4c26d 100644
    --- a/vendor/rails/actionpack/lib/action_controller/base.rb
    +++ b/vendor/rails/actionpack/lib/action_controller/base.rb
    @@ -1072,7 +1072,7 @@ module ActionController #:nodoc:
             end
    
             response.redirected_to = options
    -        logger.info("Redirected to #{options}") if logger && logger.info?
    +        logger.info("Redirected to #{options.inspect}") if logger && logger.info?
    
             case options
               # The scheme name consist of a letter followed by any combination of
    
    

    February 16th, 2009 @ 04:38 AM

  2. Pratik
    Pratik
    • Assigned user set to Pratik
    • State changed from new to incomplete

    Could you please submit a failing test case ? actionpack/test/controller/logging_test.rb would be the place to put the test.

    Thanks !

    March 8th, 2009 @ 01:29 PM

  3. Kieran P
    Kieran P

    As of Rails 2.3 RC2, this issue is no longer valid (the code has changed from outputting a options hash or url string to always a url string (which makes debugging easier). Please close as fixed/invalid.

    March 8th, 2009 @ 11:52 PM

  4. Pratik
    Pratik
    • State changed from incomplete to invalid

    March 9th, 2009 @ 12:04 AM