Sha256: 57f8dd72da24d131b5003fbbf08d97883eb45c7712b4e02dc537dfe8b8a0baf2

Contents?: true

Size: 411 Bytes

Versions: 17

Compression:

Stored size: 411 Bytes

Contents

require "json"
module SemanticLogger
  module Formatters
    class Json < Raw
      # Default JSON time format is ISO8601
      def initialize(time_format: :iso_8601, time_key: :timestamp, **args)
        super(time_format: time_format, time_key: time_key, **args)
      end

      # Returns log messages in JSON format
      def call(log, logger)
        super(log, logger).to_json
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
semantic_logger-4.16.1 lib/semantic_logger/formatters/json.rb
semantic_logger-4.16.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.15.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.14.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.13.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.12.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.11.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.10.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.9.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.8.2 lib/semantic_logger/formatters/json.rb
semantic_logger-4.8.1 lib/semantic_logger/formatters/json.rb
semantic_logger-4.8.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.7.4 lib/semantic_logger/formatters/json.rb
semantic_logger-4.7.3 lib/semantic_logger/formatters/json.rb
semantic_logger-4.7.2 lib/semantic_logger/formatters/json.rb
semantic_logger-4.7.1 lib/semantic_logger/formatters/json.rb
semantic_logger-4.7.0 lib/semantic_logger/formatters/json.rb