Module: Logging

Included in:
Session
Defined in:
lib/rakeoff/support/logging.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configure_logger_for(classname) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rakeoff/support/logging.rb', line 16

def configure_logger_for(classname)
      level = Logger::ERROR

      if(defined?(LOGGING_LEVEL))
        level = LOGGING_LEVEL
      end      

      logger = Logger.new(STDOUT)
      logger.level = level
      logger.progname = classname
      logger
end

.logger_for(classname) ⇒ Object



12
13
14
# File 'lib/rakeoff/support/logging.rb', line 12

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

Instance Method Details

#loggerObject



4
5
6
# File 'lib/rakeoff/support/logging.rb', line 4

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