From ae26408796ffd9e837c352379d3b0ea97a9600b8 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Fri, 28 Oct 2022 12:13:28 +0800 Subject: [PATCH] Update documentations --- user_guide_src/source/changelogs/v4.3.0.rst | 4 +++- user_guide_src/source/general/errors.rst | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/changelogs/v4.3.0.rst b/user_guide_src/source/changelogs/v4.3.0.rst index 683dff2c8c90..22f5bfb1977d 100644 --- a/user_guide_src/source/changelogs/v4.3.0.rst +++ b/user_guide_src/source/changelogs/v4.3.0.rst @@ -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 ====== diff --git a/user_guide_src/source/general/errors.rst b/user_guide_src/source/general/errors.rst index 152d6f74a7bc..bbc18c513721 100644 --- a/user_guide_src/source/general/errors.rst +++ b/user_guide_src/source/general/errors.rst @@ -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 @@ -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 @@ -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.