Remove terminating line breaks from wfDebugLog calls

Change-Id: Iac61ba7924597d654df7bf0a9136eeb3adbe0eef
This commit is contained in:
DannyS712 2020-06-03 02:25:39 +00:00
parent 0c0a60c87b
commit cbbd029cac
3 changed files with 16 additions and 17 deletions

View file

@ -76,14 +76,14 @@ class SquidPurgeClientPool {
Wikimedia\restoreWarnings();
if ( $numReady === false ) {
wfDebugLog( 'squid', __METHOD__ . ': Error in stream_select: ' .
socket_strerror( socket_last_error() ) . "\n" );
socket_strerror( socket_last_error() ) );
break;
}
// Check for timeout, use 1% tolerance since we aimed at having socket_select()
// exit at precisely the overall timeout
if ( microtime( true ) - $startTime > $this->timeout * 0.99 ) {
wfDebugLog( 'squid', __CLASS__ . ": timeout ({$this->timeout}s)\n" );
wfDebugLog( 'squid', __CLASS__ . ": timeout ({$this->timeout}s)" );
break;
} elseif ( !$numReady ) {
continue;

View file

@ -95,23 +95,23 @@ class WebPHandler extends BitmapHandler {
* file is not a valid WebP file.
*/
public static function extractMetadata( $filename ) {
wfDebugLog( 'WebP', __METHOD__ . ": Extracting metadata from $filename\n" );
wfDebugLog( 'WebP', __METHOD__ . ": Extracting metadata from $filename" );
$info = RiffExtractor::findChunksFromFile( $filename, 100 );
if ( $info === false ) {
wfDebugLog( 'WebP', __METHOD__ . ": Not a valid RIFF file\n" );
wfDebugLog( 'WebP', __METHOD__ . ": Not a valid RIFF file" );
return false;
}
if ( $info['fourCC'] != 'WEBP' ) {
wfDebugLog( 'WebP', __METHOD__ . ': FourCC was not WEBP: ' .
bin2hex( $info['fourCC'] ) . " \n" );
bin2hex( $info['fourCC'] ) );
return false;
}
$metadata = self::extractMetadataFromChunks( $info['chunks'], $filename );
if ( !$metadata ) {
wfDebugLog( 'WebP', __METHOD__ . ": No VP8 chunks found\n" );
wfDebugLog( 'WebP', __METHOD__ . ": No VP8 chunks found" );
return false;
}
@ -136,7 +136,7 @@ class WebPHandler extends BitmapHandler {
$chunkHeader = file_get_contents( $filename, false, null,
$chunk['start'], self::MINIMUM_CHUNK_HEADER_LENGTH );
wfDebugLog( 'WebP', __METHOD__ . ": {$chunk['fourCC']}\n" );
wfDebugLog( 'WebP', __METHOD__ . ": {$chunk['fourCC']}" );
switch ( $chunk['fourCC'] ) {
case 'VP8 ':
@ -168,7 +168,7 @@ class WebPHandler extends BitmapHandler {
$syncCode = substr( $header, 11, 3 );
if ( $syncCode != "\x9D\x01\x2A" ) {
wfDebugLog( 'WebP', __METHOD__ . ': Invalid sync code: ' .
bin2hex( $syncCode ) . "\n" );
bin2hex( $syncCode ) );
return [];
}
// Bytes 14-17 are image size
@ -193,7 +193,7 @@ class WebPHandler extends BitmapHandler {
// Byte 8 is 0x2F called the signature
if ( $header[8] != "\x2F" ) {
wfDebugLog( 'WebP', __METHOD__ . ': Invalid signature: ' .
bin2hex( $header[8] ) . "\n" );
bin2hex( $header[8] ) );
return [];
}
// Bytes 9-12 contain the image size

View file

@ -216,7 +216,7 @@ class ParserCache {
$cacheTime = $optionsKey->getCacheTime();
wfDebugLog( "ParserCache",
"Parser options key expired, touched {$wikiPage->getTouched()}"
. ", epoch {$this->cacheEpoch}, cached $cacheTime\n" );
. ", epoch {$this->cacheEpoch}, cached $cacheTime" );
return false;
} elseif ( $useOutdated < self::USE_OUTDATED &&
$optionsKey->isDifferentRevision( $wikiPage->getLatest() )
@ -225,7 +225,7 @@ class ParserCache {
$revId = $wikiPage->getLatest();
$cachedRevId = $optionsKey->getCacheRevisionId();
wfDebugLog( "ParserCache",
"ParserOutput key is for an old revision, latest $revId, cached $cachedRevId\n"
"ParserOutput key is for an old revision, latest $revId, cached $cachedRevId"
);
return false;
}
@ -297,7 +297,7 @@ class ParserCache {
$cacheTime = $value->getCacheTime();
wfDebugLog( "ParserCache",
"ParserOutput key expired, touched $touched, "
. "epoch {$this->cacheEpoch}, cached $cacheTime\n" );
. "epoch {$this->cacheEpoch}, cached $cacheTime" );
$value = false;
} elseif (
!$useOutdated
@ -307,7 +307,7 @@ class ParserCache {
$revId = $wikiPage->getLatest();
$cachedRevId = $value->getCacheRevisionId();
wfDebugLog( "ParserCache",
"ParserOutput key is for an old revision, latest $revId, cached $cachedRevId\n"
"ParserOutput key is for an old revision, latest $revId, cached $cachedRevId"
);
$value = false;
} elseif (
@ -315,7 +315,7 @@ class ParserCache {
) {
$this->incrementStats( $wikiPage, 'miss.rejected' );
wfDebugLog( "ParserCache",
"ParserOutput key valid, but rejected by RejectParserCacheValue hook handler.\n"
"ParserOutput key valid, but rejected by RejectParserCacheValue hook handler."
);
$value = false;
} else {
@ -368,10 +368,9 @@ class ParserCache {
$msg = "Saved in parser cache with key $parserOutputKey" .
" and timestamp $cacheTime" .
" and revision id $revId" .
"\n";
" and revision id $revId";
$parserOutput->mText .= "\n<!-- $msg -->\n";
$parserOutput->mText .= "\n<!-- $msg\n -->\n";
wfDebug( $msg );
// Save the parser output