cartodb-4.42/app/helpers/logger_controller_helper.rb

25 lines
493 B
Ruby
Raw Permalink Normal View History

2024-04-06 13:25:13 +08:00
module LoggerControllerHelper
extend ActiveSupport::Concern
include ::LoggerHelper
def log_rescue_from(hook_id, exception)
log_info(message: 'Captured exception in rescue_from hook', exception: exception, hook_id: hook_id)
end
private
def log_context
{
current_user: current_user&.username,
request_id: request.uuid,
controller: controller_id
}.with_indifferent_access
end
def controller_id
"#{self.class.name}##{action_name}"
end
end