Set app logger

For issue #183 I have the same problem with Rails 4.1.6 and Ruby 2.1 with that, we have covered some cases ^^
This commit is contained in:
Néstor Coppi 2014-12-18 11:07:17 -03:00
parent 63ccd91836
commit 415dc31c97
1 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,13 @@ module Google
# #
class Railtie < Rails::Railtie class Railtie < Rails::Railtie
initializer 'google-api-client' do |app| initializer 'google-api-client' do |app|
Google::APIClient.logger = app.logger _logger = case
when app.respond_to?(:logger) then app.logger
when app.config.respond_to?(:logger) then app.config.logger
else Rails.logger
end
Google::APIClient.logger = _logger
end end
end end
end end