2014-09-17 14:47:27 +00:00
|
|
|
require 'rails/railtie'
|
2013-01-03 04:07:17 +00:00
|
|
|
require 'google/api_client/logging'
|
|
|
|
|
|
|
|
module Google
|
|
|
|
class APIClient
|
|
|
|
|
|
|
|
##
|
|
|
|
# Optional support class for Rails. Currently replaces the built-in logger
|
|
|
|
# with Rails' application log.
|
|
|
|
#
|
|
|
|
class Railtie < Rails::Railtie
|
|
|
|
initializer 'google-api-client' do |app|
|
2014-12-19 23:45:20 +00:00
|
|
|
logger = app.config.logger || Rails.logger
|
|
|
|
Google::APIClient.logger = logger unless logger.nil?
|
2013-01-03 04:07:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|