Skip to content

Commit

Permalink
Update documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Oct 28, 2022
1 parent 4f24c27 commit ae26408
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion user_guide_src/source/changelogs/v4.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ Helpers and Functions
Error Handling
==============

- You can now log deprecation errors instead of throwing them. See :ref:`logging_deprecation_errors` for details.
- You can now log deprecation warnings instead of throwing them. See :ref:`logging_deprecation_warnings` for details.
- Logging of deprecations are turned on by default. Default logger reporting threshold has been increased to ``5`` to log deprecation warnings.
- To enable throwing of deprecations, set the environment variable ``CODEIGNITER_SCREAM_DEPRECATIONS`` to a truthy value.

Others
======
Expand Down
9 changes: 6 additions & 3 deletions user_guide_src/source/general/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ When an exception implementing ``HasExitCodeInterface`` is caught by CodeIgniter

.. _logging_deprecation_errors:

Logging Deprecation Errors
==========================
Logging Deprecation Warnings
============================

.. versionadded:: 4.3.0

Expand All @@ -152,7 +152,7 @@ First, make sure your copy of ``Config\Exceptions`` is updated with the two new

Next, depending on the log level you set in ``Config\Exceptions::$deprecationLogLevel``, check whether the
logger threshold defined in ``Config\Logger::$threshold`` covers the deprecation log level. If not, adjust
it accordingly.
it accordingly. In default installations starting with ``v4.3.0``, this is set to ``5``.

.. literalinclude:: errors/013.php

Expand All @@ -161,3 +161,6 @@ After that, subsequent deprecations will be logged instead of thrown.
This feature also works with user deprecations:

.. literalinclude:: errors/014.php

For testing your application you may want to always throw on deprecations. You may configure this by
setting the environment variable ``CODEIGNITER_SCREAM_DEPRECATIONS`` to a truthy value.

0 comments on commit ae26408

Please sign in to comment.