Sha256: c382f1474e08e994223f4d1430f36dfb7db54e6a86abf7cd9810b4bb1a88d828

Contents?: true

Size: 473 Bytes

Versions: 13

Compression:

Stored size: 473 Bytes

Contents

# frozen_string_literal: true

require 'ougai'
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

13 entries across 13 versions & 1 rubygems

Version Path
getaround_utils-0.2.34 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.33 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.32 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.31 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.29 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.28 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.27 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.26 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.25 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.24 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.23 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.22 lib/getaround_utils/ougai/json_formatter.rb
getaround_utils-0.2.21 lib/getaround_utils/ougai/json_formatter.rb