Class: Tenderloin::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/tenderloin/util.rb

Constant Summary collapse

@@singleton_logger =
nil

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.reset_logger!Object



41
42
43
# File 'lib/tenderloin/util.rb', line 41

def reset_logger!
  @@singleton_logger = nil
end

.singleton_loggerObject



32
33
34
35
36
37
38
39
# File 'lib/tenderloin/util.rb', line 32

def singleton_logger
  # TODO: Buffer messages until config is loaded, then output them?
  if Tenderloin.config.loaded?
    @@singleton_logger ||= Tenderloin::Logger.new(Tenderloin.config.tenderloin.log_output)
  else
    Tenderloin::Logger.new(nil)
  end
end

Instance Method Details

#format_message(level, time, progname, msg) ⇒ Object



46
47
48
# File 'lib/tenderloin/util.rb', line 46

def format_message(level, time, progname, msg)
  "[#{level} #{time.strftime('%m-%d-%Y %X')}] Tenderloin: #{msg}\n"
end