Module: BlueviaLogger

Included in:
Bluevia::BaseClient, Bluevia::BlueviaClient, Bluevia::ServicesFactory
Defined in:
lib/bluevia/bluevia_logger.rb

Instance Method Summary collapse

Instance Method Details

#create_logger(output = nil) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/bluevia/bluevia_logger.rb', line 23

def create_logger(output=nil)
  output.nil? and output = STDOUT
  logger = Logger.new(output)
  logger.level = Logger::ERROR
  logger.datetime_format = "%Y-%m-%d %H:%M:%S"
  logger
end

#log_level=(level) ⇒ Object



19
20
21
# File 'lib/bluevia/bluevia_logger.rb', line 19

def log_level=(level)
  logger.level = level
end

#loggerObject



15
16
17
# File 'lib/bluevia/bluevia_logger.rb', line 15

def logger
  $logger||=create_logger
end

#logger=(value) ⇒ Object



11
12
13
# File 'lib/bluevia/bluevia_logger.rb', line 11

def logger=(value)
  $logger = value
end