Sha256: b2e91e72286febd5c486348f360f708a48ea73845e8bbdafc3b6dcf97b431d61
Contents?: true
Size: 779 Bytes
Versions: 9
Compression:
Stored size: 779 Bytes
Contents
# frozen_string_literal: true module Cloudenvoy # Logger configuration for publishers class PublisherLogger < LoggerWrapper # # The subscriber default context processor. # # @return [Proc] The context processor proc. # def self.default_context_processor @default_context_processor ||= ->(loggable) { loggable.message&.to_h&.slice(:id, :metadata, :topic) || {} } end # # Format main log message. # # @param [String] msg The message to log. # # @return [String] The formatted log message # def formatted_message(msg) [ '[Cloudenvoy]', "[#{loggable.class}]", loggable.message&.id ? "[#{loggable.message.id}]" : nil, ' ', msg ].compact.join end end end
Version data entries
9 entries across 9 versions & 1 rubygems