*
* Controlling globals:
* $wgDebugLogFile - points to the log file
- * $wgProfileOnly - if set, normal debug messages will not be recorded.
* $wgDebugRawPage - if false, 'action=raw' hits will not result in debug output.
* $wgDebugComments - if on, some debug items may appear in comments in the HTML output.
*
* - false: same as 'log'
*/
function wfDebug( $text, $dest = 'all' ) {
- global $wgDebugLogFile, $wgProfileOnly, $wgDebugRawPage, $wgDebugLogPrefix;
+ global $wgDebugLogFile, $wgDebugRawPage, $wgDebugLogPrefix;
if ( !$wgDebugRawPage && wfIsDebugRawPage() ) {
return;
MWDebug::debugMsg( $text );
}
- if ( $wgDebugLogFile != '' && !$wgProfileOnly ) {
+ if ( $wgDebugLogFile != '' ) {
# Strip unprintables; they can switch terminal modes when binary data
# gets dumped, which is pretty annoying.
$text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1f]!', ' ', $text );
* @todo document
*/
function wfLogProfilingData() {
- global $wgRequestTime, $wgDebugLogFile, $wgDebugRawPage, $wgRequest;
- global $wgProfileLimit, $wgUser;
+ global $wgRequestTime, $wgDebugLogFile, $wgDebugLogGroups, $wgDebugRawPage;
+ global $wgProfileLimit, $wgUser, $wgRequest;
StatCounter::singleton()->flush();
$profiler->logData();
// Check whether this should be logged in the debug file.
- if ( $wgDebugLogFile == '' || ( !$wgDebugRawPage && wfIsDebugRawPage() ) ) {
+ if ( isset( $wgDebugLogGroups['profileoutput'] )
+ && $wgDebugLogGroups['profileoutput'] === false
+ ) {
+ // Explicitely disabled
+ return;
+ }
+ if ( !isset( $wgDebugLogGroups['profileoutput'] ) && $wgDebugLogFile == '' ) {
+ // Logging not enabled; no point going further
+ return;
+ }
+ if ( !$wgDebugRawPage && wfIsDebugRawPage() ) {
return;
}
gmdate( 'YmdHis' ), $elapsed,
urldecode( $requestUrl . $forward ) );
- wfErrorLog( $log . $profiler->getOutput(), $wgDebugLogFile );
+ wfDebugLog( 'profileoutput', $log . $profiler->getOutput() );
}
/**