Class: Protor::LoggerClient
- Inherits:
-
Object
- Object
- Protor::LoggerClient
- Defined in:
- lib/protor/logger_client.rb
Instance Attribute Summary collapse
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(logger, formatter) ⇒ LoggerClient
constructor
A new instance of LoggerClient.
- #publish(payload) ⇒ Object
Constructor Details
#initialize(logger, formatter) ⇒ LoggerClient
Returns a new instance of LoggerClient.
5 6 7 8 |
# File 'lib/protor/logger_client.rb', line 5 def initialize(logger, formatter) @logger = logger @formatter = formatter end |
Instance Attribute Details
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
3 4 5 |
# File 'lib/protor/logger_client.rb', line 3 def formatter @formatter end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
3 4 5 |
# File 'lib/protor/logger_client.rb', line 3 def logger @logger end |
Instance Method Details
#publish(payload) ⇒ Object
10 11 12 13 14 |
# File 'lib/protor/logger_client.rb', line 10 def publish(payload) formatter.format(payload) do |msg| logger.info(msg) end end |