Class: Wisper::Broadcasters::LoggerBroadcaster Private

Inherits:
Object
  • Object
show all
Defined in:
lib/wisper/broadcasters/logger_broadcaster.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(logger, broadcaster) ⇒ LoggerBroadcaster

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of LoggerBroadcaster.



6
7
8
9
# File 'lib/wisper/broadcasters/logger_broadcaster.rb', line 6

def initialize(logger, broadcaster)
  @logger      = logger
  @broadcaster = broadcaster
end

Instance Method Details

#broadcast(listener, publisher, event, *args, **kwargs) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
14
# File 'lib/wisper/broadcasters/logger_broadcaster.rb', line 11

def broadcast(listener, publisher, event, *args, **kwargs)
  @logger.info("[WISPER] #{name(publisher)} published #{event} to #{name(listener)} with #{args_info(args)} and #{kwargs_info(kwargs)}")
  @broadcaster.broadcast(listener, publisher, event, *args, **kwargs)
end