Skip to content

Commit

Permalink
Merge pull request #8525 from nextcloud/enhancement/dev-logging-function
Browse files Browse the repository at this point in the history
Document logger function in dev manual
  • Loading branch information
ChristophWurst authored Jun 7, 2022
2 parents d6ee1d9 + 92cdbcd commit 86a1163
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions developer_manual/basics/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Logging
.. sectionauthor:: Bernhard Posselt <dev@bernhard-posselt.com>

The logger is present by default in the container. The app that is logging is
set automatically.
set automatically. Nextcloud uses a :ref:`PSR3 <psr3>` logger.

The logger can be used in the following way:

Expand All @@ -30,14 +30,14 @@ The logger can be used in the following way:
}
}
In cases where you can not :ref:`inject <dependency-injection>` 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
<?php
use function OCP\Log\logger;
* **emergency**
* **alert**
* **critical**
* **error**
* **warning**
* **notice**
* **info**
* **debug**
logger('calendar')->warning('look, no dependency injection');

0 comments on commit 86a1163

Please sign in to comment.