Class: ArgumentMergerLogger
- Inherits:
-
ActiveSupport::BufferedLogger
- Object
- ActiveSupport::BufferedLogger
- ArgumentMergerLogger
- Defined in:
- lib/quarter_system/argumentation/errors.rb
Overview
Error classes.
Constant Summary collapse
- SEVERITIES =
Severity.constants.inject([]) { |arr, c| arr[Severity.const_get(c)] = c; arr }
Instance Method Summary collapse
- #add(severity, message = nil, progname = nil, &block) ⇒ Object
- #format_message(severity, timestamp, progname, msg) ⇒ Object
Instance Method Details
#add(severity, message = nil, progname = nil, &block) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/quarter_system/argumentation/errors.rb', line 10 def add(severity, =nil, progname=nil, &block) return if @level > severity = ( || block.try(:call) || progname).to_s = (severity, Time.zone.now, progname, ) buffer << auto_flush end |
#format_message(severity, timestamp, progname, msg) ⇒ Object
6 7 8 |
# File 'lib/quarter_system/argumentation/errors.rb', line 6 def (severity, , progname, msg) "(#{.to_s(:db)})[#{SEVERITIES[severity]}]: #{msg.strip}\n" end |