From cdcb806070f5b15750f74463f651bc68084fc266 Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 9 Jul 2009 20:51:52 +0000 Subject: [PATCH] Add extra site debugging support to enable conditionally enable display_errors or a special error_log. Fixes #10202 props sivel. git-svn-id: http://svn.automattic.com/wordpress/trunk@11702 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-settings.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-settings.php b/wp-settings.php index af78449d0..1c49f8d09 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -201,8 +201,16 @@ function timer_stop($display = 0, $precision = 3) { //if called like timer_stop( timer_start(); // Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development. -if (defined('WP_DEBUG') and WP_DEBUG == true) { +if ( defined('WP_DEBUG') && WP_DEBUG == true ) { error_reporting(E_ALL); + // Add define('WP_DEBUG_DISPLAY', false); to wp-config.php to use the globally configured setting for display_errors and not force it to On + if ( ! defined('WP_DEBUG_DISPLAY') || WP_DEBUG_DISPLAY == true ) + ini_set('display_errors', 1); + // Add define('WP_DEBUG_LOG', true); to enable php debug logging to WP_CONTENT_DIR/debug.log + if ( defined('WP_DEBUG_LOG') && WP_DEBUG_LOG == true ) { + ini_set('log_errors', 1); + ini_set('error_log', WP_CONTENT_DIR . '/debug.log'); + } } else { if ( defined('E_RECOVERABLE_ERROR') ) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR);