Class: Warren::Handler::Log
Overview
Class Warren::Log provides a dummy RabbitMQ connection pool for use during development
Defined Under Namespace
Classes: Channel, Exchange, Queue
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#<<(message) ⇒ Warren::Log
Sends a message to the log channel.
-
#initialize(logger:, routing_key_prefix: nil) ⇒ Log
constructor
A new instance of Log.
- #new_channel ⇒ Object
-
#with_channel {|new_channel| ... } ⇒ void
Yields a Warren::Log::Channel.
Methods inherited from Base
Constructor Details
#initialize(logger:, routing_key_prefix: nil) ⇒ Log
Returns a new instance of Log.
73 74 75 76 77 |
# File 'lib/warren/handler/log.rb', line 73 def initialize(logger:, routing_key_prefix: nil) super() @logger = logger @routing_key_template = Handler.routing_key_template(routing_key_prefix) end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
71 72 73 |
# File 'lib/warren/handler/log.rb', line 71 def logger @logger end |
Instance Method Details
#<<(message) ⇒ Warren::Log
Sends a message to the log channel. Useful if you only need to send one message.
104 105 106 |
# File 'lib/warren/handler/log.rb', line 104 def <<() with_channel { |c| c << } end |
#new_channel ⇒ Object
79 80 81 |
# File 'lib/warren/handler/log.rb', line 79 def new_channel Channel.new(@logger, routing_key_template: @routing_key_template) end |
#with_channel {|new_channel| ... } ⇒ void
This method returns an undefined value.
Yields a Warren::Log::Channel
90 91 92 |
# File 'lib/warren/handler/log.rb', line 90 def with_channel yield new_channel end |