amelioration(data_fixer/dossier_champs_missing): ajoute du log
This commit is contained in:
parent
70c54808fa
commit
ec2e03f24e
1 changed files with 16 additions and 0 deletions
|
@ -26,6 +26,7 @@ class DataFixer::DossierChampsMissing
|
||||||
added_champs = added_champs_root + added_champs_in_repetition
|
added_champs = added_champs_root + added_champs_in_repetition
|
||||||
if !added_champs.empty?
|
if !added_champs.empty?
|
||||||
dossier.save!
|
dossier.save!
|
||||||
|
log_champs_added(dossier, added_champs)
|
||||||
added_champs.size
|
added_champs.size
|
||||||
else
|
else
|
||||||
0
|
0
|
||||||
|
@ -62,4 +63,19 @@ class DataFixer::DossierChampsMissing
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def log_champs_added(dossier, added_champs)
|
||||||
|
app_traces = caller.reject { _1.match?(%r{/ruby/.+/gems/}) }.map { _1.sub(Rails.root.to_s, "") }
|
||||||
|
|
||||||
|
payload = {
|
||||||
|
message: "DataFixer::DossierChampsMissing",
|
||||||
|
dossier_id: dossier.id,
|
||||||
|
champs_ids: added_champs.map(&:id).join(","),
|
||||||
|
caller: app_traces
|
||||||
|
}
|
||||||
|
|
||||||
|
logger = Lograge.logger || Rails.logger
|
||||||
|
|
||||||
|
logger.info payload.to_json
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue