module Loggery::Util
Public Instance Methods
log_job_runtime(job_type, job_instance_name) { || ... }
click to toggle source
# File lib/loggery/util.rb, line 7 def log_job_runtime(job_type, job_instance_name) job_name = "Job type #{job_type} - #{job_instance_name}" begin start_time = Time.current yield if block_given? ensure end_time = Time.current duration = end_time - start_time Rails.logger.info event_type: :"#{job_type}_finished", message: "#{job_name} finished", duration: duration end end