Permalink
Browse files

fix bugs after testing with an app

  • Loading branch information...
1 parent 920f8c2 commit 01b5bcc572e3baed1618f4068920dd83bd491fb2 @wuputah wuputah committed Mar 8, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −2 lib/rails_log_stdout/rails2.rb
  2. +1 −1 lib/rails_log_stdout/rails3.rb
  3. +2 −2 lib/rails_log_stdout/railtie.rb
@@ -9,15 +9,15 @@ def self.set_logger
classes.each do |klass_name|
begin
klass = constantize(klass_name)
- klass.logger = Rails.logger
+ klass.logger = ::Rails.logger
rescue NameError => exception
puts "WARNING: #{exception.message}"
end
end
end
def redefine_rails_logger!
- class << Rails
+ class << ::Rails
def memoized_heroku_logger
@logger ||= self.heroku_stdout_logger
end
@@ -4,7 +4,7 @@ module RailsLogStdout
class Rails3 < Rails
def self.set_logger(config)
super()
- Rails.logger = config.logger = heroku_stdout_logger
+ ::Rails.logger = config.logger = heroku_stdout_logger
end
end
end
@@ -1,8 +1,8 @@
require 'rails_log_stdout/rails3'
module RailsLogStdout
- class Railtie < Rails::Railtie
- config.after_configuration do
+ class Railtie < ::Rails::Railtie
+ config.after_initialize do
Rails3.set_logger(config)
end
end

0 comments on commit 01b5bcc

Please sign in to comment.