Skip to content

Commit 770c53d

Browse files
committed
Update documentations
1 parent bf8e4c7 commit 770c53d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

user_guide_src/source/changelogs/v4.3.0.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ Helpers and Functions
204204
Error Handling
205205
==============
206206

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

209211
Others
210212
======

user_guide_src/source/general/errors.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ Since v4.3.0, you can specify the exit code for your Exception class to implemen
134134

135135
When an exception implementing ``HasExitCodeInterface`` is caught by CodeIgniter's exception handler, the code returned from the ``getExitCode()`` method will become the exit code.
136136

137-
.. _logging_deprecation_errors:
137+
.. _logging_deprecation_warnings:
138138

139-
Logging Deprecation Errors
140-
==========================
139+
Logging Deprecation Warnings
140+
============================
141141

142142
.. versionadded:: 4.3.0
143143

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

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

157157
.. literalinclude:: errors/013.php
158158

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

163163
.. literalinclude:: errors/014.php
164+
165+
For testing your application you may want to always throw on deprecations. You may configure this by
166+
setting the environment variable ``CODEIGNITER_SCREAM_DEPRECATIONS`` to a truthy value.

0 commit comments

Comments
 (0)