Remove use of $dest = 'log' for wfDebugLog
authorBryan Davis <bd808@wikimedia.org>
Wed, 30 Dec 2015 19:48:01 +0000 (12:48 -0700)
committerBryan Davis <bd808@wikimedia.org>
Wed, 30 Dec 2015 20:03:14 +0000 (13:03 -0700)
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

includes/AjaxResponse.php
includes/OutputPage.php
includes/cache/HTMLFileCache.php
includes/debug/MWDebug.php

index db989a4..6c2782c 100644 (file)
@@ -223,12 +223,12 @@ class AjaxResponse {
                $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 @@ class AjaxResponse {
                        $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 @@ class AjaxResponse {
                                $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 @@ class AjaxResponse {
                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" );
                        }
                }
 
index 78eb458..3e0564b 100644 (file)
@@ -816,7 +816,7 @@ class OutputPage extends ContextSource {
 
                $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 @@ class OutputPage extends ContextSource {
                }
 
                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 @@ class OutputPage extends ContextSource {
                                        # 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 @@ class OutputPage extends ContextSource {
                                        # 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 @@ class OutputPage extends ContextSource {
                        } 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 @@ class OutputPage extends ContextSource {
                                $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.
index 298f6e2..29db9c6 100644 (file)
@@ -178,7 +178,7 @@ class HTMLFileCache extends FileCacheBase {
                        return $text;
                }
 
-               wfDebug( __METHOD__ . "()\n", 'log' );
+               wfDebug( __METHOD__ . "()\n", 'private' );
 
                $now = wfTimestampNow();
                if ( $this->useGzip() ) {
index 841636c..8f943bf 100644 (file)
@@ -300,7 +300,7 @@ class MWDebug {
                        trigger_error( $msg, $level );
                }
 
-               wfDebugLog( $group, $msg, 'log' );
+               wfDebugLog( $group, $msg, 'private' );
        }
 
        /**