Class: Logiku::Normalizers::ActiveSupport
- Inherits:
-
Object
- Object
- Logiku::Normalizers::ActiveSupport
- Defined in:
- lib/logiku/normalizers/active_support.rb
Instance Method Summary collapse
- #call(severity, timestamp, progname, message) ⇒ Object
-
#initialize(formatter) ⇒ ActiveSupport
constructor
A new instance of ActiveSupport.
Constructor Details
#initialize(formatter) ⇒ ActiveSupport
Returns a new instance of ActiveSupport.
3 4 5 |
# File 'lib/logiku/normalizers/active_support.rb', line 3 def initialize(formatter) @formatter = formatter end |
Instance Method Details
#call(severity, timestamp, progname, message) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/logiku/normalizers/active_support.rb', line 7 def call(severity, , progname, ) if .kind_of? String else data = { severity: severity, time: , progname: progname } data.merge! if .kind_of? Hash formatter.call(data.reject { |_, value| value.nil? }) end end |