Sha256: 59cd44a88ee123835430466237f77600c7c3b625725cac15c815c51ca79012f0

Contents?: true

Size: 670 Bytes

Versions: 11

Compression:

Stored size: 670 Bytes

Contents

# frozen_string_literal: true

module Cloudenvoy
  # Logger configuration for subscribers
  class SubscriberLogger < 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}] #{msg}"
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cloudenvoy-0.6.0 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.6.rc1 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.5.0 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.5.rc1 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.4.2 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.4.1 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.4.0 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.3.1 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.3.0 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.2.0 lib/cloudenvoy/subscriber_logger.rb
cloudenvoy-0.1.0 lib/cloudenvoy/subscriber_logger.rb