From 7955a191498bbca5e433c2e14bee084191835b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 18 Jun 2018 13:23:28 +0200 Subject: [PATCH] Add some logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/FileService.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php index adeaad4af..bf2553ac4 100644 --- a/lib/Service/FileService.php +++ b/lib/Service/FileService.php @@ -23,7 +23,6 @@ namespace OCA\Deck\Service; - use OC\Security\CSP\ContentSecurityPolicyManager; use OCA\Deck\Db\Attachment; use OCP\AppFramework\Http\ContentSecurityPolicy; @@ -35,23 +34,26 @@ use OCP\Files\NotPermittedException; use OCP\Files\SimpleFS\ISimpleFile; use OCP\Files\SimpleFS\ISimpleFolder; use OCP\IL10N; +use OCP\ILogger; use OCP\IRequest; - class FileService implements IAttachmentService { private $l10n; private $appData; private $request; + private $logger; public function __construct( IL10N $l10n, IAppData $appData, - IRequest $request + IRequest $request, + ILogger $logger ) { $this->l10n = $l10n; $this->appData = $appData; $this->request = $request; + $this->logger = $logger; } /** @@ -84,9 +86,10 @@ class FileService implements IAttachmentService { try { $file = $this->getFileForAttachment($attachment); } catch (NotFoundException $e) { - // TODO: log error + $this->logger->info('Extending data for file attachment failed'); return $attachment; } catch (NotPermittedException $e) { + $this->logger->info('Extending data for file attachment failed'); return $attachment; } $attachment->setExtendedData([