Merge "Drop wfErrorLog, deprecated in 1.25"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 29 Sep 2018 01:56:53 +0000 (01:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 29 Sep 2018 01:56:53 +0000 (01:56 +0000)
RELEASE-NOTES-1.32
includes/GlobalFunctions.php
includes/debug/logger/LegacyLogger.php
includes/debug/logger/monolog/LegacyFormatter.php
includes/debug/logger/monolog/LegacyHandler.php

index 60f5e6a..c32aa49 100644 (file)
@@ -323,6 +323,8 @@ because of Phabricator reports.
 * The '--tidy' option to maintenance/parse.php has been removed.  Tidying
   the output is now the default.  Use '--no-tidy' to bypass the tidy
   phase.
+* The global function wfErrorLog, deprecated since 1.25, has now been removed.
+  Use MWLoggerLegacyLogger::emit or UDPTransport.
 
 === Deprecations in 1.32 ===
 * HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit
index 336cb89..c769b0a 100644 (file)
@@ -1147,26 +1147,6 @@ function wfLogWarning( $msg, $callerOffset = 1, $level = E_USER_WARNING ) {
        MWDebug::warning( $msg, $callerOffset + 1, $level, 'production' );
 }
 
-/**
- * Log to a file without getting "file size exceeded" signals.
- *
- * Can also log to TCP or UDP with the syntax udp://host:port/prefix. This will
- * send lines to the specified port, prefixed by the specified prefix and a space.
- * @since 1.25 support for additional context data
- *
- * @param string $text
- * @param string $file Filename
- * @param array $context Additional logging context data
- * @throws MWException
- * @deprecated since 1.25 Use \MediaWiki\Logger\LegacyLogger::emit or UDPTransport
- */
-function wfErrorLog( $text, $file, array $context = [] ) {
-       wfDeprecated( __METHOD__, '1.25' );
-       $logger = LoggerFactory::getInstance( 'wfErrorLog' );
-       $context['destination'] = $file;
-       $logger->info( trim( $text ), $context );
-}
-
 /**
  * @todo document
  * @todo Move logic to MediaWiki.php
index d4a79d9..9d0789c 100644 (file)
@@ -29,7 +29,7 @@ use Psr\Log\LogLevel;
 use UDPTransport;
 
 /**
- * PSR-3 logger that mimics the historic implementation of MediaWiki's
+ * PSR-3 logger that mimics the historic implementation of MediaWiki's former
  * wfErrorLog logging implementation.
  *
  * This logger is configured by the following global configuration variables:
@@ -145,10 +145,6 @@ class LegacyLogger extends AbstractLogger {
                        // specfied.
                        $shouldEmit = (bool)$wgDBerrorLog;
 
-               } elseif ( $channel === 'wfErrorLog' ) {
-                       // All messages on the wfErrorLog channel should be emitted.
-                       $shouldEmit = true;
-
                } elseif ( $channel === 'wfDebug' ) {
                        // wfDebug messages are emitted if a catch all logging file has
                        // been specified. Checked explicitly so that 'private' flagged
@@ -192,10 +188,9 @@ class LegacyLogger extends AbstractLogger {
        /**
         * Format a message.
         *
-        * Messages to the 'wfDebug', 'wfLogDBError' and 'wfErrorLog' channels
-        * receive special formatting to mimic the historic output of the functions
-        * of the same name. All other channel values are formatted based on the
-        * historic output of the `wfDebugLog()` global function.
+        * Messages to the 'wfDebug' and 'wfLogDBError' channels receive special formatting to mimic the
+        * historic output of the functions of the same name. All other channel values are formatted
+        * based on the historic output of the `wfDebugLog()` global function.
         *
         * @param string $channel
         * @param string $message
@@ -211,9 +206,6 @@ class LegacyLogger extends AbstractLogger {
                } elseif ( $channel === 'wfLogDBError' ) {
                        $text = self::formatAsWfLogDBError( $channel, $message, $context );
 
-               } elseif ( $channel === 'wfErrorLog' ) {
-                       $text = "{$message}\n";
-
                } elseif ( $channel === 'profileoutput' ) {
                        // Legacy wfLogProfilingData formatitng
                        $forward = '';
index 92624a0..3cf6e46 100644 (file)
@@ -24,9 +24,9 @@ use MediaWiki\Logger\LegacyLogger;
 use Monolog\Formatter\NormalizerFormatter;
 
 /**
- * Log message formatter that mimics the legacy log message formatting of
- * `wfDebug`, `wfDebugLog`, `wfLogDBError` and `wfErrorLog` global functions by
- * delegating the formatting to \MediaWiki\Logger\LegacyLogger.
+ * Log message formatter that mimics the legacy log message formatting of `wfDebug`, `wfDebugLog`,
+ * `wfLogDBError` and the former `wfErrorLog` global functions by delegating the formatting to
+ * \MediaWiki\Logger\LegacyLogger.
  *
  * @since 1.25
  * @copyright © 2013 Wikimedia Foundation and contributors
index dbeb136..258a9a8 100644 (file)
@@ -27,7 +27,7 @@ use Monolog\Logger;
 use UnexpectedValueException;
 
 /**
- * Log handler that replicates the behavior of MediaWiki's wfErrorLog()
+ * Log handler that replicates the behavior of MediaWiki's former wfErrorLog()
  * logging service. Log output can be directed to a local file, a PHP stream,
  * or a udp2log server.
  *