Refactor logging across controllers and jobs to use a centralized log method; improve consistency and readability of log messages

This commit is contained in:
2026-02-27 22:32:07 -05:00
parent f32b48296d
commit 9c0f153518
10 changed files with 107 additions and 31 deletions

View File

@@ -25,7 +25,7 @@ class EstimateController < ApplicationController
Estimate.sync_by_doc_number(params[:search])
e = Estimate.find_by_doc_number(params[:search])
rescue
logger.info "Estimate.find_by_doc_number failed"
log "Estimate.find_by_doc_number failed"
end
end
@@ -35,7 +35,7 @@ class EstimateController < ApplicationController
Estimate.sync_by_id(params[:id])
e = Estimate.find_by_id(params[:id])
rescue
logger.info "Estimate.find_by_id failed"
log "Estimate.find_by_id failed"
end
end
@@ -68,4 +68,10 @@ class EstimateController < ApplicationController
end
end
private
def log(msg)
Rails.logger.info "[EstimateController] #{msg}"
end
end