Class: Cloudenvoy::PublisherLogger
- Inherits:
-
LoggerWrapper
- Object
- LoggerWrapper
- Cloudenvoy::PublisherLogger
- Defined in:
- lib/cloudenvoy/publisher_logger.rb
Overview
Logger configuration for publishers
Instance Attribute Summary
Attributes inherited from LoggerWrapper
Class Method Summary collapse
-
.default_context_processor ⇒ Proc
The subscriber default context processor.
Instance Method Summary collapse
-
#formatted_message(msg) ⇒ String
Format main log message.
Methods inherited from LoggerWrapper
#context_processor, #debug, #error, #fatal, #info, #initialize, #log_block, #logger, #method_missing, #respond_to_missing?
Constructor Details
This class inherits a constructor from Cloudenvoy::LoggerWrapper
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Cloudenvoy::LoggerWrapper
Class Method Details
.default_context_processor ⇒ Proc
The subscriber default context processor.
11 12 13 |
# File 'lib/cloudenvoy/publisher_logger.rb', line 11 def self.default_context_processor @default_context_processor ||= ->(loggable) { loggable..to_h&.slice(:id, :metadata, :topic) || {} } end |
Instance Method Details
#formatted_message(msg) ⇒ String
Format main log message.
22 23 24 25 26 27 28 29 30 |
# File 'lib/cloudenvoy/publisher_logger.rb', line 22 def (msg) [ '[Cloudenvoy]', "[#{loggable.class}]", loggable.&.id ? "[#{loggable..id}]" : nil, ' ', msg ].compact.join end |