Initial logging support
This commit is contained in:
1 parent
85593ba938
commit
8f453134d7
2 files changed
+42
-6
No files matched your search
@@ -0,0 +1,30 @@
|
||||
require 'logger'
|
||||
|
||||
module Google
|
||||
class APIClient
|
||||
|
||||
class << self
|
||||
##
|
||||
# Logger for the API client
|
||||
#
|
||||
# @return [Logger] logger instance.
|
||||
attr_accessor :logger
|
||||
end
|
||||
|
||||
self.logger = Logger.new(STDOUT)
|
||||
self.logger.level = Logger::WARN
|
||||
end
|
||||
|
||||
##
|
||||
# Module to make accessing the logger simpler
|
||||
module Logging
|
||||
##
|
||||
# Logger for the API client
|
||||
#
|
||||
# @return [Logger] logger instance.
|
||||
def logger
|
||||
Google::APIClient.logger
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user