Module: KairosDB::Logging

Included in:
Client
Defined in:
lib/kairosdb/logging.rb

Constant Summary collapse

PREFIX =
"[KairosDB] "

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.loggerObject



11
12
13
14
# File 'lib/kairosdb/logging.rb', line 11

def self.logger
  return false if @logger == false
  @logger ||= ::Logger.new(STDERR).tap { |logger| logger.level = Logger::INFO }
end

Instance Method Details

#log(level, message) ⇒ Object



16
17
18
# File 'lib/kairosdb/logging.rb', line 16

def log(level, message)
  KairosDB::Logging.logger.send(level.to_sym, PREFIX + message) if KairosDB::Logging.logger
end