Class: Picnic::Logger::Base
- Inherits:
-
Logger
- Object
- Logger
- Picnic::Logger::Base
- Defined in:
- lib/picnic/logger.rb
Instance Method Summary collapse
- #format_message(severity, datetime, progrname, msg) ⇒ Object
-
#initialize(logdev, shift_age = 0, shift_size = 1048576) ⇒ Base
constructor
A new instance of Base.
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 (severity, datetime, progrname, msg) (@formatter || @default_formatter).call(severity, datetime, progname, msg) end |