Class: ActionMessageTexter::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- ActionMessageTexter::LogSubscriber
- Defined in:
- lib/action_message_texter/log_subscriber.rb
Instance Method Summary collapse
-
#deliver(event) ⇒ Object
delivery log.
- #logger ⇒ Object
-
#process(event) ⇒ Object
process message log.
Instance Method Details
#deliver(event) ⇒ Object
delivery log
6 7 8 9 10 11 12 13 14 |
# File 'lib/action_message_texter/log_subscriber.rb', line 6 def deliver(event) info do = event.payload[:content] to = event.payload[:to] deliver_at = event.payload[:deliver_at] texter = event.payload[:texter] "#{texter}: Delivered message [#{}] to #{to} at #{deliver_at}" end end |
#logger ⇒ Object
25 26 27 |
# File 'lib/action_message_texter/log_subscriber.rb', line 25 def logger ActionMessageTexter::Base.logger end |
#process(event) ⇒ Object
process message log
17 18 19 20 21 22 23 |
# File 'lib/action_message_texter/log_subscriber.rb', line 17 def process(event) debug do messenger = event.payload[:messenger] action = event.payload[:action] "#{messenger}##{action}: processed short Message in #{event.duration.round(1)}ms" end end |