Class: GraphiteAPI::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/graphite-api/logger.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



19
20
21
# File 'lib/graphite-api/logger.rb', line 19

def logger
  @logger
end

Class Method Details

.init(options) ⇒ Object



21
22
23
24
# File 'lib/graphite-api/logger.rb', line 21

def init options
  self.logger = ::Logger.new options[:dev] ||  STDOUT
  self.logger.level= ::Logger.const_get options[:level].to_s.upcase
end

.method_missing(m, *args, &block) ⇒ Object



26
27
28
# File 'lib/graphite-api/logger.rb', line 26

def method_missing(m,*args,&block)
  logger.send m, *args, &block if logger.respond_to? m
end