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
- #respond_with(event) ⇒ Object
- #start_processing(event) ⇒ Object
Instance Method Details
#halted_callback(event) ⇒ Object
31 32 33 |
# File 'lib/telegram/bot/updates_controller/log_subscriber.rb', line 31 def halted_callback(event) info { "Filter chain halted at #{event.payload[:filter].inspect}" } end |
#process_action(event) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/telegram/bot/updates_controller/log_subscriber.rb', line 17 def process_action(event) info do payload = event.payload additions = UpdatesController.log_process_action(payload) = "Completed in #{event.duration.round}ms" += " (#{additions.join(' | ')})" if additions.present? end end |
#respond_with(event) ⇒ Object
27 28 29 |
# File 'lib/telegram/bot/updates_controller/log_subscriber.rb', line 27 def respond_with(event) info { "Responded with #{event.payload[:type]}" } end |
#start_processing(event) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/telegram/bot/updates_controller/log_subscriber.rb', line 9 def start_processing(event) info do payload = event.payload "Processing by #{payload[:controller]}##{payload[:action]}\n" \ " Update: #{payload[:update].to_json}" end end |