Sha256: c9e9620c6bae4f5cc25d3b3af558754e90573bb3ced7a5ad2b36830117bb5c4c
Contents?: true
Size: 1.08 KB
Versions: 13
Compression:
Stored size: 1.08 KB
Contents
require 'active_support/log_subscriber' module Telegram module Bot class UpdatesController class LogSubscriber < ActiveSupport::LogSubscriber def start_processing(event) info do payload = event.payload "Processing by #{payload[:controller]}##{payload[:action]}\n" \ " Update: #{payload[:update].to_json}" end end def process_action(event) info do payload = event.payload additions = UpdatesController.log_process_action(payload) message = "Completed in #{event.duration.round}ms" message << " (#{additions.join(' | ')})" unless additions.blank? message end end def respond_with(event) info { "Responded with #{event.payload[:type]}" } end def halted_callback(event) info { "Filter chain halted at #{event.payload[:filter].inspect}" } end delegate :logger, to: UpdatesController attach_to 'updates_controller.bot.telegram' end end end end
Version data entries
13 entries across 13 versions & 1 rubygems