class Amazon::Coral::LogFactory

A simple log retrieval interface to allow injection of common logging frameworks.

Public Class Methods

getLog(key) click to toggle source

Invokes the singleton LogFactory instance to retrieve a logger for a given key.

# File lib/amazon/coral/logfactory.rb, line 15
def LogFactory.getLog(key)
  return @@instance.getLog(key)
end
setInstance(instance) click to toggle source

Specifies a LogFactory instance which will handle log requests. Call this method early in execution prior to instantiating handlers to replace the default no-op log.

# File lib/amazon/coral/logfactory.rb, line 21
def LogFactory.setInstance(instance)
  @@instance = instance
end

Public Instance Methods

getLog(key) click to toggle source

Default logging implementation which returns a null logger.

# File lib/amazon/coral/logfactory.rb, line 26
def getLog(key)
  log = Logger.new(nil)
  log.level = Logger::FATAL
  return log
end