diff options
author | Gergő Tisza <tgr.huwiki@gmail.com> | 2017-10-23 01:29:20 -0700 |
---|---|---|
committer | Gergő Tisza <tgr.huwiki@gmail.com> | 2017-10-26 21:06:03 -0700 |
commit | 7d9dbc0040034e1dbe97c959d37d96c8ca400aa5 (patch) | |
tree | b3399cfd2a713a3cd4a3169e03b285701c726747 /includes/shell/CommandFactory.php | |
parent | fdb3f0d08a1f67231e8ea1a0abb8e42bfdf0f457 (diff) | |
download | mediawikicore-7d9dbc0040034e1dbe97c959d37d96c8ca400aa5.tar.gz mediawikicore-7d9dbc0040034e1dbe97c959d37d96c8ca400aa5.zip |
MediaWiki\Shell: log stderr
Change-Id: I1495fe2aba10102d7e36c3a3e5fdabf97f14546b
Diffstat (limited to 'includes/shell/CommandFactory.php')
-rw-r--r-- | includes/shell/CommandFactory.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/includes/shell/CommandFactory.php b/includes/shell/CommandFactory.php index c0b8f899ed2e..84dd50f71fbb 100644 --- a/includes/shell/CommandFactory.php +++ b/includes/shell/CommandFactory.php @@ -37,6 +37,9 @@ class CommandFactory { /** @var string|bool */ private $cgroup; + /** @var bool */ + private $doLogStderr = false; + /** * Constructor * @@ -50,6 +53,16 @@ class CommandFactory { } /** + * 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 * * @return Command @@ -60,6 +73,7 @@ class CommandFactory { return $command ->limits( $this->limits ) - ->cgroup( $this->cgroup ); + ->cgroup( $this->cgroup ) + ->logStderr( $this->doLogStderr ); } } |