Class: LunaPark::Notifiers::TaggedLog::TaggedFormatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/luna_park/notifiers/tagged_log/tagged_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config.



9
10
11
# File 'lib/luna_park/notifiers/tagged_log/tagged_formatter.rb', line 9

def config
  @config
end

Instance Method Details

#call(severity, timestamp, _, msg, tags = nil) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/luna_park/notifiers/tagged_log/tagged_formatter.rb', line 11

def call(severity, timestamp, _, msg, tags = nil)
  payload = common_payload(severity, timestamp, tags)
            .merge(msg_payload(msg[:original_msg]))

  deep_merge!(payload, details_payload(msg[:details]))

  ::JSON.generate(payload) << "\n"
end