diff options
author | Timo Tijhof <krinkle@fastmail.com> | 2022-04-06 01:12:40 +0100 |
---|---|---|
committer | Krinkle <krinkle@fastmail.com> | 2022-04-13 00:29:40 +0000 |
commit | 1b218b2b54c637050e8ebe866ca77866d7c07370 (patch) | |
tree | edcc65d7466cf20dba380617656b439ab2401b1c /includes/DevelopmentSettings.php | |
parent | fb1d1cec6f26a7c7455c0466efda28a21f72d0b8 (diff) | |
download | mediawikicore-1b218b2b54c637050e8ebe866ca77866d7c07370.tar.gz mediawikicore-1b218b2b54c637050e8ebe866ca77866d7c07370.zip |
debug: Fix $wgDebugRawPage to work with PSR-3 debug logging
The benefit of this setting was largely lost due to wfDebug() having
been replaced with calls to Logger->debug() for much of our code.
This is motivated by making ResourcLoader debug=2 able to make
its concurrent load.php requests more quickly during local dev.
This effectively reverts T49960. I was wrong there, thinking that
this variable has no reason for being. The vast majority of the time,
these aren't of interest on subresource requests. It's trivial
to enable when wanted, and any non-debug level messages still come
through either way, including PHP runtime errors, exceptions,
warnings, etc.
This seems to make load.php about 50% faster for local development
when using mediawiki-docker.
I used `ab` to perform a load.php request 300 times. The mean was
320-360ms before this patch (with and without DebugRawPage=false),
and around 120-140ms with patch (with DebugRawPage=false, default).
Bug: T85805
Bug: T225730
Change-Id: I061419adebf43e83cd0103bdb9b7a3296a2a1122
Diffstat (limited to 'includes/DevelopmentSettings.php')
-rw-r--r-- | includes/DevelopmentSettings.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/includes/DevelopmentSettings.php b/includes/DevelopmentSettings.php index 3ad81ac28bc6..6befaf430d91 100644 --- a/includes/DevelopmentSettings.php +++ b/includes/DevelopmentSettings.php @@ -11,6 +11,21 @@ */ /** + * Ad-hoc debugging + * + * To keep your Git copy clean and easier to work with, it is recommended + * to copy this to your LocalSettings.php and enable them as-needed. + * This are not enabled by default as they make the wiki considerably + * slower and/or significantly alter how things work or look. + * + * See https://www.mediawiki.org/wiki/How_to_debug + */ + +// $wgDebugDumpSql = true; +// $wgDebugRawPage = true; +// $wgDebugToolbar = true; + +/** * Debugging for PHP */ @@ -24,7 +39,7 @@ ini_set( 'display_errors', 1 ); */ global $wgDevelopmentWarnings, $wgShowExceptionDetails, $wgShowHostnames, - $wgDebugRawPage, $wgCommandLineMode, $wgDebugLogFile, + $wgCommandLineMode, $wgDebugLogFile, $wgDBerrorLog, $wgDebugLogGroups; // Use of wfWarn() should cause tests to fail @@ -33,7 +48,6 @@ $wgDevelopmentWarnings = true; // Enable showing of errors $wgShowExceptionDetails = true; $wgShowHostnames = true; -$wgDebugRawPage = true; // T49960 // Enable log files $logDir = getenv( 'MW_LOG_DIR' ); |