Skip to content

Commit defe86c

Browse files
committed
Turn on logging for deprecations as default
1 parent e85085c commit defe86c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

app/Config/Exceptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Exceptions extends BaseConfig
6060
* Use this option to temporarily cease the warnings and instead log those.
6161
* This option also works for user deprecations.
6262
*/
63-
public bool $logDeprecationsOnly = false;
63+
public bool $logDeprecationsOnly = true;
6464

6565
/**
6666
* --------------------------------------------------------------------------

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474

7575
<php>
7676
<server name="app.baseURL" value="http://example.com/"/>
77+
<server name="CODEIGNITER_SCREAM_DEPRECATIONS" value="1"/>
7778
<!-- Directory containing phpunit.xml -->
7879
<const name="HOMEPATH" value="./"/>
7980
<!-- Directory containing the Paths config file -->

system/Debug/Exceptions.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ public function exceptionHandler(Throwable $exception)
158158
*/
159159
public function errorHandler(int $severity, string $message, ?string $file = null, ?int $line = null)
160160
{
161-
if ($this->isDeprecationError($severity) && $this->config->logDeprecationsOnly) {
161+
if ($this->isDeprecationError($severity)) {
162+
if (! $this->config->logDeprecationsOnly || (bool) env('CODEIGNITER_SCREAM_DEPRECATIONS')) {
163+
throw new ErrorException($message, 0, $severity, $file, $line);
164+
}
165+
162166
return $this->handleDeprecationError($message, $file, $line);
163167
}
164168

0 commit comments

Comments
 (0)