Sha256: 64b7d5573fc547dfe728fbbfeb8c27118c2b9e6e2132288a73071d41fd30fe37
Contents?: true
Size: 525 Bytes
Versions: 18
Compression:
Stored size: 525 Bytes
Contents
require "json" module Sapience module Formatters class Json < Raw # Default JSON time format is ISO8601 def initialize(options = {}) options = options.dup options[:time_format] = :iso_8601 unless options.key?(:time_format) super(options) end # Returns log messages in JSON format def call(log, logger) h = super(log, logger) h.delete(:time) h[:timestamp] = format_time(log.time) h.to_json end end end end
Version data entries
18 entries across 18 versions & 1 rubygems