Class: RailsTwirp::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- RailsTwirp::LogSubscriber
- Defined in:
- lib/rails_twirp/log_subscriber.rb
Instance Method Summary collapse
Instance Method Details
#process_action(event) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rails_twirp/log_subscriber.rb', line 15 def process_action(event) payload = event.payload exception_raised(payload[:http_request], payload[:exception_object]) if payload[:exception_object] info do code = payload.fetch(:code, :internal) = +"Completed #{code}" << ": #{payload[:msg]}" if payload[:msg] << " in #{event.duration.round}ms (Allocations: #{event.allocations})" << "\n\n" if defined?(Rails.env) && Rails.env.development? end end |
#start_processing(event) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/rails_twirp/log_subscriber.rb', line 7 def start_processing(event) return unless logger.info? payload = event.payload info "Processing by #{payload[:controller]}##{payload[:action]}" end |