Module: Synapse::Logging

Included in:
BaseWatcher, Haproxy, Synapse
Defined in:
lib/synapse/log.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configure_logger_for(classname) ⇒ Object



16
17
18
19
20
21
# File 'lib/synapse/log.rb', line 16

def configure_logger_for(classname)
  logger = Logger.new(STDERR)
  logger.level = Logger::INFO unless ENV['DEBUG']
  logger.progname = classname
  return logger
end

.logger_for(classname) ⇒ Object



12
13
14
# File 'lib/synapse/log.rb', line 12

def logger_for(classname)
  @loggers[classname] ||= configure_logger_for(classname)
end

Instance Method Details

#logObject



4
5
6
# File 'lib/synapse/log.rb', line 4

def log
  @logger ||= Logging.logger_for(self.class.name)
end