Add ConsoleLogger, use it for eval.php -d
authorTim Starling <tstarling@wikimedia.org>
Thu, 27 Apr 2017 23:56:38 +0000 (09:56 +1000)
committerTim Starling <tstarling@wikimedia.org>
Fri, 28 Apr 2017 00:05:05 +0000 (10:05 +1000)
commita59ed5f3de94a491b669c51d4f60529108b85b4b
tree66ce2d005121d6e9ac2190490d27839dde983198
parentf8ac9bb2e6a28c0623a4aa5289c24de8394d9fae
Add ConsoleLogger, use it for eval.php -d

eval.php previously set $wgDebugLogFile to /dev/stdout. This had the
following problems:

* It doesn't work if the maintenance script is executed via sudo, since
  /dev/stdout is typically owned by the original user, so MW can't open
  it. Using php://stdout worked on HHVM but not PHP.
* Setting $wgDebugLogFile has no effect if the wiki uses MonologSpi.
* Setting $wgDebugLogFile has no effect on channels configured with
  $wgDebugLogGroups.
* stderr is a more appropriate place to send logging output.
* Writing to configuration variables is discouraged.

So, add ConsoleSpi, which is a very simple logging service provider
which sends all messages to stderr. This should be suitable for
debugging with eval.php or shell.php in WMF production or beta.

Change-Id: Ib0d6ce45e0cbecd58263fc4e360c63d4149acb3a
autoload.php
includes/debug/logger/ConsoleLogger.php [new file with mode: 0644]
includes/debug/logger/ConsoleSpi.php [new file with mode: 0644]
maintenance/eval.php
maintenance/shell.php