Add logging for closest hubs selected #800
This commit is contained in:
parent
e1103cf108
commit
6139e649fb
1 changed files with 21 additions and 0 deletions
|
|
@ -168,6 +168,9 @@ class HubSelector
|
||||||
'jo_count' => 0,
|
'jo_count' => 0,
|
||||||
'inventory' => 0,
|
'inventory' => 0,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// log to file
|
||||||
|
$this->logClosestHubResult($jo_id, $row[0], $dist, $limit_distance);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -220,5 +223,23 @@ class HubSelector
|
||||||
// filter is in place
|
// filter is in place
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function logClosestHubResult($jo_id, $hub, $distance, $limit_distance)
|
||||||
|
{
|
||||||
|
// log to file
|
||||||
|
$filename = '/../../var/log/closest_hubs_selected.log';
|
||||||
|
$date = date("Y-m-d H:i:s");
|
||||||
|
|
||||||
|
// build log entry
|
||||||
|
$entry = implode("", [
|
||||||
|
"[JO: " . $jo_id . "]",
|
||||||
|
"[" . $date . "]",
|
||||||
|
"[Distance: " . $distance . " vs " . $limit_distance . "]",
|
||||||
|
" " . $hub->getName() . " (ID: " . $hub->getID() . ")",
|
||||||
|
"\r\n",
|
||||||
|
]);
|
||||||
|
|
||||||
|
@file_put_contents(__DIR__ . $filename, $entry, FILE_APPEND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue