From 92cdbcda0d766172855c1577763a2f951e395320 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 7 Jun 2022 13:55:01 +0200 Subject: [PATCH] Document logger function in dev manual Signed-off-by: Christoph Wurst --- developer_manual/basics/logging.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/developer_manual/basics/logging.rst b/developer_manual/basics/logging.rst index 6d21cda0240..db92592797b 100644 --- a/developer_manual/basics/logging.rst +++ b/developer_manual/basics/logging.rst @@ -5,7 +5,7 @@ Logging .. sectionauthor:: Bernhard Posselt The logger is present by default in the container. The app that is logging is -set automatically. +set automatically. Nextcloud uses a :ref:`PSR3 ` logger. The logger can be used in the following way: @@ -30,14 +30,14 @@ The logger can be used in the following way: } } +In cases where you can not :ref:`inject ` a logger into a class, you can use +the ``\OCP\Log\logger`` function to acquire a logger instance. As a first argument you need to pass +the app ID. -The following methods are available: +.. code-block:: php + + warning('look, no dependency injection');