Merge "Include pool type in pool counter log entries"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 22 Apr 2014 15:59:31 +0000 (15:59 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 22 Apr 2014 15:59:31 +0000 (15:59 +0000)
includes/poolcounter/PoolCounterWork.php

index 86bf8f1..523e9e0 100644 (file)
  * Class for dealing with PoolCounters using class members
  */
 abstract class PoolCounterWork {
-       protected $cacheable = false; //Does this override getCachedWork() ?
+       /** @var string */
+       protected $type = 'generic';
+       /** @var bool */
+       protected $cacheable = false; // does this override getCachedWork() ?
 
        /**
         * @param string $type The type of PoolCounter to use
         * @param string $key Key that identifies the queue this work is placed on
         */
        public function __construct( $type, $key ) {
+               $this->type = $type;
                $this->poolCounter = PoolCounter::factory( $type, $key );
        }
 
@@ -75,7 +79,7 @@ abstract class PoolCounterWork {
        public function logError( $status ) {
                $key = $this->poolCounter->getKey();
 
-               wfDebugLog( 'poolcounter', "Pool key '$key': "
+               wfDebugLog( 'poolcounter', "Pool key '$key' ({$this->type}): "
                        . $status->getMessage()->inLanguage( 'en' )->useDatabase( false )->text() );
        }