Class: Syspy::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/log.rb

Constant Summary collapse

LOG_FILE =
"syspy.log"
LOGGERS =
[]
STDOUT_LOG =
Logger.new(STDOUT)

Class Method Summary collapse

Class Method Details

.debug(message) ⇒ Object



34
35
36
# File 'lib/log.rb', line 34

def self.debug(message)
  self.log(Logger::DEBUG,message)
end

.error(message) ⇒ Object



22
23
24
# File 'lib/log.rb', line 22

def self.error(message)
  self.log(Logger::ERROR,message)
end

.fatal(message) ⇒ Object

LOGGERS << FILE_LOG



18
19
20
# File 'lib/log.rb', line 18

def self.fatal(message)
  self.log(Logger::FATAL,message)
end

.info(message) ⇒ Object



30
31
32
# File 'lib/log.rb', line 30

def self.info(message)
  self.log(Logger::INFO,message)
end

.log(severity, message) ⇒ Object



38
39
40
41
42
# File 'lib/log.rb', line 38

def self.log(severity,message) 
  LOGGERS.each(){|logger|
    logger.log(severity,message)
  } 
end

.warn(message) ⇒ Object



26
27
28
# File 'lib/log.rb', line 26

def self.warn(message)
  self.log(Logger::WARN,message)
end