From 6acd5407716fad9647ff4a5d56473f195db7fbfd Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Thu, 16 Oct 2025 17:42:22 +0530 Subject: [PATCH] Loggers and version change --- appinfo/info.xml | 2 +- lib/AppInfo/Application.php | 10 +++++----- lib/Middleware/InvitationMiddleware.php | 8 ++++---- .../BackgroundJob/CleanupOutdatedBookingJobTest.php | 7 +++---- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index e8c371e19..79e77b4a3 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -23,7 +23,7 @@ * πŸ“Ž **Attachments!** Add, upload and view event attachments * πŸ™ˆ **We’re not reinventing the wheel!** Based on the great [c-dav library](https://github.com/nextcloud/cdav-library), [ical.js](https://github.com/mozilla-comm/ical.js) and [fullcalendar](https://github.com/fullcalendar/fullcalendar) libraries. ]]> - 5.3.5 + 5.3.5+murena-20251016 agpl Richard Steinmetz Sebastian Krupinski diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index dd06e1f67..aab000e2b 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -26,7 +26,7 @@ use OCP\Defaults; use OCP\IConfig; use OCP\IDBConnection; use OCP\IL10N; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IRequest; use OCP\IUserManager; use OCP\L10N\IFactory as L10NFactory; @@ -61,8 +61,8 @@ class Application extends App implements IBootstrap { $c->get(IManager::class), $c->get(IMailer::class), $c->get(IL10N::class), - $c->get(Defaults::class), - $c->get(ILogger::class), + $c->get(Defaults::class), + $c->get(LoggerInterface::class), $c->get(IUserManager::class), $c->get(L10NFactory::class), ); @@ -85,8 +85,8 @@ class Application extends App implements IBootstrap { $c->get(IManager::class), $c->get(IMailer::class), $c->get(IL10N::class), - $c->get(Defaults::class), - $c->get(ILogger::class), + $c->get(Defaults::class), + $c->get(LoggerInterface::class), $c->get(IUserManager::class), $c->get(L10NFactory::class), ); diff --git a/lib/Middleware/InvitationMiddleware.php b/lib/Middleware/InvitationMiddleware.php index 0e8b300f2..d2a2e0b6f 100644 --- a/lib/Middleware/InvitationMiddleware.php +++ b/lib/Middleware/InvitationMiddleware.php @@ -11,7 +11,7 @@ use OCP\Defaults; use OCP\IConfig; use OCP\IDBConnection; use OCP\IL10N; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IRequest; use OCP\IUserManager; use OCP\L10N\IFactory; @@ -31,7 +31,7 @@ class InvitationMiddleware extends Middleware { IMailer $mailer, IL10N $l10n, Defaults $defaults, - ILogger $logger, + LoggerInterface $logger, IUserManager $iusermanager, IFactory $languageFactory, ) { @@ -228,8 +228,8 @@ class InvitationMiddleware extends Middleware { $message->useTemplate($emailTemplate); $this->mailer->send($message); } catch (\Exception $e) { - // Log the exception and continue - $this->logger->logException($e); + // Log the exception and continue + $this->logger->error($e->getMessage(), ['exception' => $e]); } } diff --git a/tests/php/unit/BackgroundJob/CleanupOutdatedBookingJobTest.php b/tests/php/unit/BackgroundJob/CleanupOutdatedBookingJobTest.php index a52327b4d..0a0ddeec0 100644 --- a/tests/php/unit/BackgroundJob/CleanupOutdatedBookingJobTest.php +++ b/tests/php/unit/BackgroundJob/CleanupOutdatedBookingJobTest.php @@ -13,7 +13,6 @@ use OCA\Calendar\BackgroundJob\CleanUpOutdatedBookingsJob; use OCA\Calendar\Service\Appointments\BookingService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Calendar\ICalendarQuery; -use OCP\ILogger; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; @@ -24,7 +23,7 @@ class CleanupOutdatedBookingJobTest extends TestCase { /** @var mixed|BookingService|MockObject */ private $service; - /** @var mixed|MockObject|LoggerInterface */ + /** @var mixed|MockObject|LoggerInterface */ private $logger; /** @var mixed|ITimeFactory|MockObject */ @@ -59,8 +58,8 @@ class CleanupOutdatedBookingJobTest extends TestCase { ->method('info'); $this->job->setLastRun(0); $this->job->execute( - $this->createMock(JobList::class), - $this->createMock(ILogger::class) + $this->createMock(JobList::class), + $this->createMock(LoggerInterface::class) ); } } -- GitLab