Class: Picnic::Logger::Base

Inherits:
Logger
  • Object
show all
Defined in:
lib/picnic/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(logdev, shift_age = 0, shift_size = 1048576) ⇒ Base

Returns a new instance of Base.



17
18
19
20
21
22
23
24
# File 'lib/picnic/logger.rb', line 17

def initialize(logdev, shift_age = 0, shift_size = 1048576)
  begin
    super
  rescue Exception
    puts "WARNING: Couldn't create Logger with output '#{logdev}'. Logger output will be redirected to STDOUT."
    super(STDOUT, shift_age, shift_size)
  end
end

Instance Method Details

#format_message(severity, datetime, progrname, msg) ⇒ Object



26
27
28
# File 'lib/picnic/logger.rb', line 26

def format_message(severity, datetime, progrname, msg)
  (@formatter || @default_formatter).call(severity, datetime, progname, msg)
end