Sha256: fa7e8cc181e2df90cdcc0b97de90c2b49e29a194ec9e5c663a6bdca1ea7aaffd
Contents?: true
Size: 524 Bytes
Versions: 44
Compression:
Stored size: 524 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
44 entries across 44 versions & 1 rubygems