Class: Log

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

Constant Summary collapse

@@log =
Logger.new(STDOUT)

Class Method Summary collapse

Class Method Details

.debug(&blk) ⇒ Object



15
16
17
# File 'lib/log.rb', line 15

def self.debug(&blk)
  @@log.debug &blk
end

.initializeObject



7
8
9
10
11
12
13
# File 'lib/log.rb', line 7

def self.initialize
  @@log.level = Logger::DEBUG
  @@log.formatter = proc do |severity, datetime, progname, msg|
    calling_position = caller[5].split(/^.+\//).last.split(/:/)[0,2].join(':') # gross
    "[#{datetime}] #{calling_position}: - #{msg}\n"
  end
end