Merge pull request #184 from Shelvak/logger_fix
[Issue#183] Set app logger
This commit is contained in:
commit
d19314bd27
|
@ -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