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:
parent
63ccd91836
commit
415dc31c97
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue