Class: Sapience::Extensions::ActionController::LogSubscriber

Inherits:
ActionController::LogSubscriber
  • Object
show all
Defined in:
lib/sapience/extensions/action_controller/log_subscriber.rb

Overview

rubocop:disable ClassLength

Instance Method Summary collapse

Instance Method Details

#orig_process_actionObject



8
# File 'lib/sapience/extensions/action_controller/log_subscriber.rb', line 8

alias_method :orig_process_action, :process_action

#orig_start_processingObject



7
# File 'lib/sapience/extensions/action_controller/log_subscriber.rb', line 7

alias_method :orig_start_processing, :start_processing

#process_action(event) ⇒ Object

rubocop:disable AbcSize, CyclomaticComplexity, PerceivedComplexity



15
16
17
18
19
20
21
# File 'lib/sapience/extensions/action_controller/log_subscriber.rb', line 15

def process_action(event) # rubocop:disable AbcSize, CyclomaticComplexity, PerceivedComplexity
  return unless logger.info?
  data      = request(event.payload)
  data.merge! runtimes(event)
  data.merge! exception(event.payload)
  info(data)
end

#start_processing(event) ⇒ Object

Log as debug to hide Processing messages in production



11
12
13
# File 'lib/sapience/extensions/action_controller/log_subscriber.rb', line 11

def start_processing(event)
  debug { "Processing ##{event.payload[:action]}" }
end