Class: Warren::Handler::Log::Channel
- Inherits:
-
Object
- Object
- Warren::Handler::Log::Channel
- Defined in:
- lib/warren/handler/log.rb
Overview
Mimics a Broadcast::Channel but instead passes out to a logger
Instance Method Summary collapse
-
#<<(message) ⇒ Warren::Handler::Broadcast::Channel
Logs ‘message` to the configured logger.
- #exchange(name, options) ⇒ Object
-
#initialize(logger, routing_key_template: '%s') ⇒ Channel
constructor
A new instance of Channel.
-
#prefetch(number) ⇒ Object
NOOP - Provided for API compatibility.
- #queue(name, options) ⇒ Object
Constructor Details
#initialize(logger, routing_key_template: '%s') ⇒ Channel
Returns a new instance of Channel.
12 13 14 15 |
# File 'lib/warren/handler/log.rb', line 12 def initialize(logger, routing_key_template: '%s') @logger = logger @routing_key_template = routing_key_template end |
Instance Method Details
#<<(message) ⇒ Warren::Handler::Broadcast::Channel
Logs ‘message` to the configured logger
24 25 26 27 28 |
# File 'lib/warren/handler/log.rb', line 24 def <<() @logger.info "Published: #{key_for()}" @logger.debug "Payload: #{.payload}" self end |
#exchange(name, options) ⇒ Object
30 31 32 33 |
# File 'lib/warren/handler/log.rb', line 30 def exchange(name, ) @logger.debug "Declared exchange: #{name}, #{.inspect}" Exchange.new(name, ) end |
#prefetch(number) ⇒ Object
NOOP - Provided for API compatibility
41 |
# File 'lib/warren/handler/log.rb', line 41 def prefetch(number); end |