Class: RabbitmqClient::LoggerBuilder
- Inherits:
-
Object
- Object
- RabbitmqClient::LoggerBuilder
- Defined in:
- lib/rabbitmq_client/logger_builder.rb
Overview
ExchangeRegistry is a store for all managed exchanges and their details
Instance Method Summary collapse
- #build_logger ⇒ Object
-
#initialize(config) ⇒ LoggerBuilder
constructor
A new instance of LoggerBuilder.
Constructor Details
#initialize(config) ⇒ LoggerBuilder
Returns a new instance of LoggerBuilder.
6 7 8 9 10 11 |
# File 'lib/rabbitmq_client/logger_builder.rb', line 6 def initialize(config) @logger = config[:logger].clone @format = config[:logs_format] @level = config[:logs_level].to_sym @filename = config[:logs_filename] end |
Instance Method Details
#build_logger ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rabbitmq_client/logger_builder.rb', line 13 def build_logger @logger ||= ::Logger.new(@filename || STDOUT) @logger.level = @level @logger.formatter = create_logger_formatter log_subscriber.attach_to(:rabbitmq_client) @logger end |