Merge "Add attributes parameter to ShowSearchHitTitle"
[lhc/web/wiklou.git] / includes / shell / CommandFactory.php
index c0b8f89..84dd50f 100644 (file)
@@ -37,6 +37,9 @@ class CommandFactory {
        /** @var string|bool */
        private $cgroup;
 
+       /** @var bool */
+       private $doLogStderr = false;
+
        /**
         * Constructor
         *
@@ -49,6 +52,16 @@ class CommandFactory {
                $this->setLogger( new NullLogger() );
        }
 
+       /**
+        * When enabled, text sent to stderr will be logged with a level of 'error'.
+        *
+        * @param bool $yesno
+        * @see Command::logStderr
+        */
+       public function logStderr( $yesno = true ) {
+               $this->doLogStderr = $yesno;
+       }
+
        /**
         * Instantiates a new Command
         *
@@ -60,6 +73,7 @@ class CommandFactory {
 
                return $command
                        ->limits( $this->limits )
-                       ->cgroup( $this->cgroup );
+                       ->cgroup( $this->cgroup )
+                       ->logStderr( $this->doLogStderr );
        }
 }