From 0fd5ad173c88531e2f58c317de245e39a37f5d6d Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Wed, 3 Jul 2024 11:49:08 +0200 Subject: [PATCH] feat: log file id and path when extracting the mp3 cover fails Signed-off-by: Daniel Kesselberg [skip ci] --- lib/private/Preview/MP3.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/Preview/MP3.php b/lib/private/Preview/MP3.php index 4c5f932f47792..1cb61b1352b17 100644 --- a/lib/private/Preview/MP3.php +++ b/lib/private/Preview/MP3.php @@ -30,8 +30,8 @@ use OCP\Files\File; use OCP\IImage; -use Psr\Log\LoggerInterface; use wapmorgan\Mp3Info\Mp3Info; +use function OCP\Log\logger; class MP3 extends ProviderV2 { /** @@ -52,9 +52,9 @@ public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { /** @var string|null|false $picture */ $picture = $audio->getCover(); } catch (\Throwable $e) { - \OC::$server->get(LoggerInterface::class)->info($e->getMessage(), [ - 'exception' => $e, - 'app' => 'core', + logger('core')->info('Error while getting cover from mp3 file: ' . $e->getMessage(), [ + 'fileId' => $file->getId(), + 'filePath' => $file->getPath(), ]); return null; } finally {