Class: GitReport::GLogger

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

Class Method Summary collapse

Class Method Details

.log(level, message) ⇒ Object

logs the given message in case the given level is less or equal the configured log level



6
7
8
9
10
11
# File 'lib/g_logger.rb', line 6

def self.log level, message
  File.open(
    GitReport.configuration.logfile,
    File::WRONLY|File::APPEND|File::CREAT
  ){ |f| f.write(message + "\n") } if level <= GitReport.configuration.loglevel
end