BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/261651

Change subject: Remove use of $dest = 'log' for wfDebugLog
......................................................................

Remove use of $dest = 'log' for wfDebugLog

The functionality for marking a debug log message for delivery to a log
file but not to MWDebug was removed in 1.25 with the introduction of
the PSR-3 logging system. Convert the messages that were marked for this
special handling in a7a0883 to use 'private' instead.

Bug: T122644
Change-Id: Iefaac07a5922c16c2899904c7b678199c5b1efe9
---
M includes/AjaxResponse.php
M includes/OutputPage.php
M includes/cache/HTMLFileCache.php
M includes/debug/MWDebug.php
4 files changed, 20 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/261651/1

diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php
index db989a4..6c2782c 100644
--- a/includes/AjaxResponse.php
+++ b/includes/AjaxResponse.php
@@ -223,12 +223,12 @@
                $fname = 'AjaxResponse::checkLastModified';
 
                if ( !$timestamp || $timestamp == '19700101000000' ) {
-                       wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n", 
'log' );
+                       wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP", 
'private' );
                        return false;
                }
 
                if ( !$wgCachePages ) {
-                       wfDebug( "$fname: CACHE DISABLED\n", 'log' );
+                       wfDebug( "$fname: CACHE DISABLED", 'private' );
                        return false;
                }
 
@@ -242,8 +242,8 @@
                        $modsince = preg_replace( '/;.*$/', '', 
$_SERVER["HTTP_IF_MODIFIED_SINCE"] );
                        $modsinceTime = strtotime( $modsince );
                        $ismodsince = wfTimestamp( TS_MW, $modsinceTime ? 
$modsinceTime : 1 );
-                       wfDebug( "$fname: -- client send If-Modified-Since: " . 
$modsince . "\n", 'log' );
-                       wfDebug( "$fname: --  we might send Last-Modified : 
$lastmod\n", 'log' );
+                       wfDebug( "$fname: -- client send If-Modified-Since: 
$modsince", 'private' );
+                       wfDebug( "$fname: --  we might send Last-Modified : 
$lastmod", 'private' );
 
                        if ( ( $ismodsince >= $timestamp )
                                && $wgUser->validateCache( $ismodsince ) &&
@@ -255,16 +255,16 @@
                                $this->mLastModified = $lastmod;
 
                                wfDebug( "$fname: CACHED client: $ismodsince ; 
user: {$wgUser->getTouched()} ; " .
-                                       "page: $timestamp ; site 
$wgCacheEpoch\n", 'log' );
+                                       "page: $timestamp ; site 
$wgCacheEpoch", 'private' );
 
                                return true;
                        } else {
                                wfDebug( "$fname: READY  client: $ismodsince ; 
user: {$wgUser->getTouched()} ; " .
-                                       "page: $timestamp ; site 
$wgCacheEpoch\n", 'log' );
+                                       "page: $timestamp ; site 
$wgCacheEpoch", 'private' );
                                $this->mLastModified = $lastmod;
                        }
                } else {
-                       wfDebug( "$fname: client did not send If-Modified-Since 
header\n", 'log' );
+                       wfDebug( "$fname: client did not send If-Modified-Since 
header", 'private' );
                        $this->mLastModified = $lastmod;
                }
                return false;
@@ -284,12 +284,12 @@
                if ( $mcvalue ) {
                        # Check to see if the value has been invalidated
                        if ( $touched <= $mcvalue['timestamp'] ) {
-                               wfDebug( "Got $mckey from cache\n" );
+                               wfDebug( "Got $mckey from cache" );
                                $this->mText = $mcvalue['value'];
 
                                return true;
                        } else {
-                               wfDebug( "$mckey has expired\n" );
+                               wfDebug( "$mckey has expired" );
                        }
                }
 
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 78eb458..3e0564b 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -816,7 +816,7 @@
 
                $clientHeader = $this->getRequest()->getHeader( 
'If-Modified-Since' );
                if ( $clientHeader === false ) {
-                       wfDebug( __METHOD__ . ": client did not send 
If-Modified-Since header\n", 'log' );
+                       wfDebug( __METHOD__ . ": client did not send 
If-Modified-Since header", 'private' );
                        return false;
                }
 
@@ -845,17 +845,17 @@
                }
 
                wfDebug( __METHOD__ . ": client sent If-Modified-Since: " .
-                       wfTimestamp( TS_ISO_8601, $clientHeaderTime ) . "\n", 
'log' );
+                       wfTimestamp( TS_ISO_8601, $clientHeaderTime ), 
'private' );
                wfDebug( __METHOD__ . ": effective Last-Modified: " .
-                       wfTimestamp( TS_ISO_8601, $maxModified ) . "\n", 'log' 
);
+                       wfTimestamp( TS_ISO_8601, $maxModified ), 'private' );
                if ( $clientHeaderTime < $maxModified ) {
-                       wfDebug( __METHOD__ . ": STALE, $info\n", 'log' );
+                       wfDebug( __METHOD__ . ": STALE, $info", 'private' );
                        return false;
                }
 
                # Not modified
                # Give a 304 Not Modified response code and disable body output
-               wfDebug( __METHOD__ . ": NOT MODIFIED, $info\n", 'log' );
+               wfDebug( __METHOD__ . ": NOT MODIFIED, $info", 'private' );
                ini_set( 'zlib.output_compression', 0 );
                $this->getRequest()->response()->statusHeader( 304 );
                $this->sendCacheControl();
@@ -2184,7 +2184,7 @@
                                        # We'll purge the proxy cache 
explicitly, but require end user agents
                                        # to revalidate against the proxy on 
each visit.
                                        # Surrogate-Control controls our CDN, 
Cache-Control downstream caches
-                                       wfDebug( __METHOD__ . ": proxy caching 
with ESI; {$this->mLastModified} **\n", 'log' );
+                                       wfDebug( __METHOD__ . ": proxy caching 
with ESI; {$this->mLastModified} **", 'private' );
                                        # start with a shorter timeout for 
initial testing
                                        # header( 'Surrogate-Control: 
max-age=2678400+2678400, content="ESI/1.0"');
                                        $response->header( 'Surrogate-Control: 
max-age=' . $config->get( 'SquidMaxage' )
@@ -2195,7 +2195,7 @@
                                        # to revalidate against the proxy on 
each visit.
                                        # IMPORTANT! The CDN needs to replace 
the Cache-Control header with
                                        # Cache-Control: s-maxage=0, 
must-revalidate, max-age=0
-                                       wfDebug( __METHOD__ . ": local proxy 
caching; {$this->mLastModified} **\n", 'log' );
+                                       wfDebug( __METHOD__ . ": local proxy 
caching; {$this->mLastModified} **", 'private' );
                                        # start with a shorter timeout for 
initial testing
                                        # header( "Cache-Control: 
s-maxage=2678400, must-revalidate, max-age=0" );
                                        $response->header( 'Cache-Control: 
s-maxage=' . $this->mCdnMaxage
@@ -2204,7 +2204,7 @@
                        } else {
                                # We do want clients to cache if they can, but 
they *must* check for updates
                                # on revisiting the page.
-                               wfDebug( __METHOD__ . ": private caching; 
{$this->mLastModified} **\n", 'log' );
+                               wfDebug( __METHOD__ . ": private caching; 
{$this->mLastModified} **", 'private' );
                                $response->header( 'Expires: ' . gmdate( 'D, d 
M Y H:i:s', 0 ) . ' GMT' );
                                $response->header( "Cache-Control: private, 
must-revalidate, max-age=0" );
                        }
@@ -2212,7 +2212,7 @@
                                $response->header( "Last-Modified: 
{$this->mLastModified}" );
                        }
                } else {
-                       wfDebug( __METHOD__ . ": no caching **\n", 'log' );
+                       wfDebug( __METHOD__ . ": no caching **", 'private' );
 
                        # In general, the absence of a last modified header 
should be enough to prevent
                        # the client from using its cache. We send a few other 
things just to make sure.
diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php
index 298f6e2..29db9c6 100644
--- a/includes/cache/HTMLFileCache.php
+++ b/includes/cache/HTMLFileCache.php
@@ -178,7 +178,7 @@
                        return $text;
                }
 
-               wfDebug( __METHOD__ . "()\n", 'log' );
+               wfDebug( __METHOD__ . "()\n", 'private' );
 
                $now = wfTimestampNow();
                if ( $this->useGzip() ) {
diff --git a/includes/debug/MWDebug.php b/includes/debug/MWDebug.php
index 841636c..8f943bf 100644
--- a/includes/debug/MWDebug.php
+++ b/includes/debug/MWDebug.php
@@ -300,7 +300,7 @@
                        trigger_error( $msg, $level );
                }
 
-               wfDebugLog( $group, $msg, 'log' );
+               wfDebugLog( $group, $msg, 'private' );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/261651
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iefaac07a5922c16c2899904c7b678199c5b1efe9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to