Sha256: 58b2f0fe7b190acf7834531423d94768e66e810f159d8236fdb9dd01b377fb00
Contents?: true
Size: 800 Bytes
Versions: 42
Compression:
Stored size: 800 Bytes
Contents
require "semantic_logger/formatters/default" module SemanticLogger module Formatters class Short < SemanticLogger::Formatters::Default TAGS_TO_REMOVE = [:pact_broker_git_sha, :tenant_id, :request_id, :pactflow_git_sha] def call(log, logger) self.log = log self.logger = logger [time, level, tags, named_tags, duration, message, payload, exception].compact.join(" ") end def time log.time.strftime("%H:%M:%S") end def named_tags named_tags = log.named_tags.reject{ | k, _ | TAGS_TO_REMOVE.include?(k) } return if named_tags.nil? || named_tags.empty? list = [] named_tags.each_pair { |name, value| list << "#{name}: #{value}" } "{#{list.join(', ')}}" end end end end
Version data entries
42 entries across 42 versions & 1 rubygems