Sha256: a1810bcbf4bd9710d14f5b8d32c277eb34007ae5d74ff06262a12323c701cd52
Contents?: true
Size: 688 Bytes
Versions: 17
Compression:
Stored size: 688 Bytes
Contents
require "action_controller/log_subscriber" class ActionController::LogSubscriber # rubocop:disable ClassAndModuleChildren # Log as info to show Processing messages in production def start_processing(event) controller_logger(event).info { "Processing ##{event.payload[:action]}" } end private # Returns the logger for the supplied event. # Returns ActionController::Base.logger if no controller is present def controller_logger(event) if (controller = event.payload[:controller]) begin controller.constantize.logger rescue NameError ActionController::Base.logger end else ActionController::Base.logger end end end
Version data entries
17 entries across 17 versions & 1 rubygems