From 34d17b18ec0de6953cae6f238ce6381b9646e75d Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 2 Feb 2023 18:40:30 +0100 Subject: [PATCH] Classifier: Log real file names see #588 Signed-off-by: Marcel Klehr --- lib/Classifiers/Classifier.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Classifiers/Classifier.php b/lib/Classifiers/Classifier.php index 12cc3611..75397335 100644 --- a/lib/Classifiers/Classifier.php +++ b/lib/Classifiers/Classifier.php @@ -64,6 +64,7 @@ public function setMaxExecutionTime(int $time): void { public function classifyFiles(string $model, array $queueFiles, int $timeout): \Generator { $paths = []; $processedFiles = []; + $fileNames = []; $startTime = time(); foreach ($queueFiles as $queueFile) { if ($this->maxExecutionTime > 0 && time() - $startTime > $this->maxExecutionTime) { @@ -109,6 +110,7 @@ public function classifyFiles(string $model, array $queueFiles, int $timeout): \ } $paths[] = $path; $processedFiles[] = $queueFile; + $fileNames[] = $files[0]->getPath(); } catch (NotFoundException $e) { $this->logger->warning('Could not find file', ['exception' => $e]); try { @@ -184,7 +186,7 @@ public function classifyFiles(string $model, array $queueFiles, int $timeout): \ $buffer .= "\n".$result; continue; } - $this->logger->debug('Result for ' . basename($paths[$i]) . ' = ' . $result); + $this->logger->debug('Result for ' . $fileNames[$i] .'(' . basename($paths[$i]) . ') = ' . $result); try { // decode json $results = json_decode($result, true, 512, JSON_OBJECT_AS_ARRAY | JSON_THROW_ON_ERROR | JSON_INVALID_UTF8_IGNORE);