Class: YuiRestClient::Logger

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/yui_rest_client/logger.rb

Instance Method Summary collapse

Constructor Details

#initializeLogger

Returns a new instance of Logger.



17
18
19
# File 'lib/yui_rest_client/logger.rb', line 17

def initialize
  @logger = create_logger($stdout)
end

Instance Method Details

#create_logger(output) ⇒ Object



21
22
23
24
25
26
# File 'lib/yui_rest_client/logger.rb', line 21

def create_logger(output)
  logger = ::Logger.new(output)
  logger.progname = 'YuiRestClient'
  logger.level = default_level
  logger
end

#default_levelObject



28
29
30
# File 'lib/yui_rest_client/logger.rb', line 28

def default_level
  ENV['DEBUG'] ? :debug : :info
end