mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-04-02 08:21:57 -04:00
Refactor logging across controllers and jobs to use a centralized log method; improve consistency and readability of log messages
This commit is contained in:
@@ -225,4 +225,8 @@ class CustomersController < ApplicationController
|
||||
return string
|
||||
end
|
||||
|
||||
def log(msg)
|
||||
Rails.logger.info "[CustomersController] #{msg}"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user