module Rootage::Log

Public Class Methods

debug(msg, pos=caller(1).first, pid=Process.pid) click to toggle source

Log the debug message.

# File lib/rootage/log.rb, line 24
def self.debug(msg, pos=caller(1).first, pid=Process.pid)
  logger.debug(msg, pos, pid) if logger
end
error(msg, pos=caller(1).first, pid=Process.pid) click to toggle source

Log the error message.

# File lib/rootage/log.rb, line 9
def self.error(msg, pos=caller(1).first, pid=Process.pid)
  logger.error(msg, pos, pid) if logger
end
fatal(msg, pos=caller(1).first, pid=Process.pid) click to toggle source

Log the fatal message. This level is used when system will go to shutdown.

# File lib/rootage/log.rb, line 4
def self.fatal(msg, pos=caller(1).first, pid=Process.pid)
  logger.fatal(msg, pos, pid) if logger
end
get_logger_block() click to toggle source

Get a logger block to extract a logger object.

# File lib/rootage/log.rb, line 34
def self.get_logger_block
  @logger
end
info(msg, pos=caller(1).first, pid=Process.pid) click to toggle source

Log the info message.

# File lib/rootage/log.rb, line 19
def self.info(msg, pos=caller(1).first, pid=Process.pid)
  logger.info(msg, pos, pid) if logger
end
logger() click to toggle source

Return the logger.

# File lib/rootage/log.rb, line 29
def self.logger
  @logger.call
end
set_logger_block(&block) click to toggle source

Set logger to use in ‘Log` interface.

# File lib/rootage/log.rb, line 39
def self.set_logger_block(&block)
  @logger = block
end
terminate() click to toggle source

Terminate the logger.

# File lib/rootage/log.rb, line 44
def self.terminate
  logger.terminate if logger
end
warn(msg, pos=caller(1).first, pid=Process.pid) click to toggle source

Log the warn message.

# File lib/rootage/log.rb, line 14
def self.warn(msg, pos=caller(1).first, pid=Process.pid)
  logger.warn(msg, pos, pid) if logger
end