Sha256: b00b9dfb57cfd6d89a6599d10122c37f3a875aef5cddecd5b840908ef422292f

Contents?: true

Size: 456 Bytes

Versions: 7

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

require 'json'

module GetaroundUtils; end
module GetaroundUtils::Ougai; end

class GetaroundUtils::Ougai::JsonFormatter < Ougai::Formatters::Base
  def _call(severity, _time, progname, data)
    message = data.delete(:msg)
    data = { caption: message }.merge(data) \
      unless message == 'No message'

    payload = { severity: severity, progname: progname }.merge(data).compact
    JSON.dump(payload) + "\n"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
getaround_utils-0.2.13 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.11 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.10 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.9 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.7 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.6 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.5 lib/getaround_utils/ougai/json_formatter.rb