Class: Giblog

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

Overview

The logger used from within giblish

Defined Under Namespace

Classes: GiblogFormatter

Class Method Summary collapse

Class Method Details

.loggerObject

returns the application-wide logger instance.


23
24
25
26
27
28
29
30
# File 'lib/giblish/utils.rb', line 23

def self.logger
  unless defined? @logger
    puts "!!!! Error: Trying to access logger before setup !!!!"
    puts caller
    exit
  end
  @logger
end

.setupObject

bootstrap the application-wide logger object


15
16
17
18
19
20
# File 'lib/giblish/utils.rb', line 15

def self.setup
  return if defined? @logger

  @logger = Logger.new($stdout)
  @logger.formatter = GiblogFormatter.new
end