Make WordPress Core

Opened 10 months ago

Last modified 3 months ago

#56252 new enhancement

Allow error_reporting level to be configurable for WP_DEBUG

Reported by: luistar15's profile luistar15 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.0
Component: Bootstrap/Load Keywords: has-patch
Focuses: performance Cc:

Description

I use WP_DEBUG_LOG in production to catch errors not caught during development.
But almost all entries are PHP Deprecated errors. This makes hard to spot more relevant errors.

It would be useful to be able to configure the error level report when using WP_DEBUG.

Attachments (1)

WP_DEBUG_ERROR_LEVEL.png (60.8 KB) - added by luistar15 10 months ago.
In the mean time I have modified the wp_debug_mode() function to acomplish what I need

Download all attachments as: .zip

Change History (5)

@luistar15
10 months ago

In the mean time I have modified the wp_debug_mode() function to acomplish what I need

#1 follow-up: @knutsp
10 months ago

Could this be combined into one constant? When WP_DEBUG is integer, use as error_level, otherwise truthy /falsey as currently. A few other constants work in a similar way.

#2 in reply to: ↑ 1 @luistar15
10 months ago

Replying to knutsp:

Could this be combined into one constant? When WP_DEBUG is integer, use as error_level, otherwise truthy /falsey as currently. A few other constants work in a similar way.

I wouldn't mind that. But personally a prefer multiple explicit settings rather that one that could mean many things.

This ticket was mentioned in PR #2994 on WordPress/wordpress-develop by luistar15.


10 months ago
#3

  • Keywords has-patch added

The new constant WP_DEBUG_ERROR_LEVEL can be set from wp-config.php to override the E_ALL level forced in wp_debug_mode() .

Trac ticket: https://core.trac.wordpress.org/ticket/56252

#4 @mikebricknellbarlow
3 months ago

Seconding this request - just been configuring my local dev environment so that I can leave WP_DEBUG turned on, but only see breaking errors. I ended up implementing the same solution as @luistar15, and actually came here to suggest it until I saw it was already here.

This would be a great help for agency developers like myself, who don't need to be seeing 100s of deprecated warnings from Core and plugins while trying to debug custom code.

Note: See TracTickets for help on using tickets.