Class: Telegram::Bot::UpdatesController::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- Telegram::Bot::UpdatesController::LogSubscriber
- Defined in:
- lib/telegram/bot/updates_controller/log_subscriber.rb
Instance Method Summary collapse
- #halted_callback(event) ⇒ Object
- #process_action(event) ⇒ Object
- #reply_with(event) ⇒ Object
- #start_processing(event) ⇒ Object
Instance Method Details
#halted_callback(event) ⇒ Object
29 30 31 |
# File 'lib/telegram/bot/updates_controller/log_subscriber.rb', line 29 def halted_callback(event) info { "Filter chain halted at #{event.payload[:filter].inspect}" } end |
#process_action(event) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/telegram/bot/updates_controller/log_subscriber.rb', line 15 def process_action(event) info do payload = event.payload additions = UpdatesController.log_process_action(payload) = "Completed in #{event.duration.round}ms" << " (#{additions.join(' | ')})" unless additions.blank? end end |
#reply_with(event) ⇒ Object
25 26 27 |
# File 'lib/telegram/bot/updates_controller/log_subscriber.rb', line 25 def reply_with(event) info { "Replied with #{event.payload[:type]}" } end |
#start_processing(event) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/telegram/bot/updates_controller/log_subscriber.rb', line 7 def start_processing(event) info do payload = event.payload "Processing by #{payload[:controller]}##{payload[:action]}\n" \ " Update: #{payload[:update].to_json}" end end |