global $wgDebugLogPrefix, $wgShowDebug;
static $cache = array(); // Cache of unoutputted messages
- $text = wfDebugTimer() . $text;
if ( !$wgDebugRawPage && wfIsDebugRawPage() ) {
return;
}
+ $timer = wfDebugTimer();
+ if ( $timer !== '' ) {
+ $text = preg_replace( '/[^\n]/', $timer . '\0', $text, 1 );
+ }
+
if ( ( $wgDebugComments || $wgShowDebug ) && !$logonly ) {
$cache[] = $text;
# Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
$wgRequest = new WebRequest;
- $debug = "Start request\n\n{$_SERVER['REQUEST_METHOD']} {$wgRequest->getRequestURL()}";
+ $debug = "\n\nStart request\n{$_SERVER['REQUEST_METHOD']} {$wgRequest->getRequestURL()}\n";
if ( $wgDebugPrintHttpHeaders ) {
- $debug .= "\nHTTP HEADERS:\n";
+ $debug .= "HTTP HEADERS:\n";
foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
$debug .= "$name: $value\n";
}
}
- wfDebug( "$debug\n" );
+ wfDebug( $debug );
}
wfProfileOut( $fname . '-misc1' );