From 3e7ea30d746b417598662742f3b18f7a2b210a83 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 19 Sep 2024 14:22:27 +0200 Subject: [PATCH 1/2] fix(developer): Add note about PSR logger version and DI Signed-off-by: Ferdinand Thiessen --- developer_manual/basics/dependency_injection.rst | 1 + developer_manual/digging_deeper/psr.rst | 2 ++ 2 files changed, 3 insertions(+) diff --git a/developer_manual/basics/dependency_injection.rst b/developer_manual/basics/dependency_injection.rst index b1e8da1d95a..34f19b06f79 100644 --- a/developer_manual/basics/dependency_injection.rst +++ b/developer_manual/basics/dependency_injection.rst @@ -398,6 +398,7 @@ Types: * ``\OCP\IUserManager`` * ``\OCP\IUserSession`` * ``\Psr\Container\ContainerInterface`` +* ``\Psr\Log\LoggerInterface`` How to enable it ^^^^^^^^^^^^^^^^ diff --git a/developer_manual/digging_deeper/psr.rst b/developer_manual/digging_deeper/psr.rst index 006abdd49bf..0ac945ebf49 100644 --- a/developer_manual/digging_deeper/psr.rst +++ b/developer_manual/digging_deeper/psr.rst @@ -28,6 +28,8 @@ The dependency injection container can inject an instance of a ``\Psr\Log\Logger Nextcloud ships version 1.1.3 .. versionchanged:: 23 Nextcloud ships version 1.1.4 +.. versionchanged:: 30 + Nextcloud ships version 2.0.0 .. _psr4: From a7f76a02e6985d9f83df26fcce2d29744520e256 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 19 Sep 2024 14:25:32 +0200 Subject: [PATCH 2/2] chore(developer): Add docs about `ILogger` removal Signed-off-by: Ferdinand Thiessen --- .../app_upgrade_guide/upgrade_to_31.rst | 8 ++++++++ developer_manual/basics/dependency_injection.rst | 1 - developer_manual/digging_deeper/psr.rst | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_31.rst b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_31.rst index 4efb50398db..664107483dc 100644 --- a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_31.rst +++ b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_31.rst @@ -74,6 +74,7 @@ Changed APIs ^^^^^^^^^^^^ - Clarify ``OCP\Files\Storage\IStorage::getOwner()`` returns ``string|false``. +- The Nextcloud implementation of the ``log`` method of ``Psr\Log\LoggerInterface`` now supports ``Psr\Log\LogLevel`` as log level parameter. Deprecated APIs ^^^^^^^^^^^^^^^ @@ -84,3 +85,10 @@ Removed APIs ^^^^^^^^^^^^ - Legacy, non functional, ``OC_App::getForms`` was removed. +- All ``OCP\ILogger`` logging methods, deprecated since Nextcloud 20, are removed. + - The interface now only holds the Nextcloud internal logging level constants. + For all logging ``Psr\Log\LoggerInterface`` should be used. + - The ``OCP\ILogger`` interface can no longer be dependency injected as it now only holds constants. + - ``OCP\IServerContainer::getLogger`` was removed, use dependency injection with ``Psr\Log\LoggerInterface`` instead. +- The internal class ``OC\AppFramework\Logger`` was removed, it should have been never used by apps. + All using apps should migrate to ``Psr\Log\LoggerInterface``. \ No newline at end of file diff --git a/developer_manual/basics/dependency_injection.rst b/developer_manual/basics/dependency_injection.rst index 34f19b06f79..adb738ea701 100644 --- a/developer_manual/basics/dependency_injection.rst +++ b/developer_manual/basics/dependency_injection.rst @@ -381,7 +381,6 @@ Types: * ``\OCP\Files\IRootFolder`` * ``\OCP\IGroupManager`` * ``\OCP\IL10N`` -* ``\OCP\ILogger`` * ``\OCP\BackgroundJob\IJobList`` * ``\OCP\INavigationManager`` * ``\OCP\IPreview`` diff --git a/developer_manual/digging_deeper/psr.rst b/developer_manual/digging_deeper/psr.rst index 0ac945ebf49..99e6dedc6cc 100644 --- a/developer_manual/digging_deeper/psr.rst +++ b/developer_manual/digging_deeper/psr.rst @@ -22,7 +22,8 @@ PSR-3: Logger Interface .. versionadded:: 19 -The dependency injection container can inject an instance of a ``\Psr\Log\LoggerInterface``. This is merely a wrapper of the existing (and strongly typed) ``\OCP\ILogger``. Apps may still use the Nextcloud logger, but the `PSR-3`_ implementation shall easy the integration of 3rd party libraries that require the `PSR-3`_ logger. +The dependency injection container can inject an instance of a ``\Psr\Log\LoggerInterface``. +The `PSR-3`_ implementation shall easy the integration of 3rd party libraries that require the `PSR-3`_ logger. .. versionchanged:: 21 Nextcloud ships version 1.1.3 @@ -30,6 +31,8 @@ The dependency injection container can inject an instance of a ``\Psr\Log\Logger Nextcloud ships version 1.1.4 .. versionchanged:: 30 Nextcloud ships version 2.0.0 +.. versionchanged:: 31 + The ``\Psr\Log\LoggerInterface`` fully replaced the Nextcloud internal logging methods. .. _psr4: