From: Bryan Davis Date: Mon, 15 Dec 2014 23:12:57 +0000 (-0700) Subject: Deprecate wfErrorLog X-Git-Tag: 1.31.0-rc.0~12949^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=6a8c686c7a22c52abb76127def23bfc01316824f;p=lhc%2Fweb%2Fwiklou.git Deprecate wfErrorLog When a logging service other than MWLoggerLegacySpi is used, the behavior of wfErrorLog is not guaranteed. Change-Id: I8543bfd556aa752665f7a3daa855d3c2f7fc8956 --- diff --git a/api.php b/api.php index cc589b0f60..92e670475d 100644 --- a/api.php +++ b/api.php @@ -122,7 +122,7 @@ if ( $wgAPIRequestLog ) { } else { $items[] = "failed in ApiBeforeMain"; } - wfErrorLog( implode( ',', $items ) . "\n", $wgAPIRequestLog ); + MWLoggerLegacyLogger::emit( implode( ',', $items ) . "\n", $wgAPIRequestLog ); wfDebug( "Logged API request to $wgAPIRequestLog\n" ); } diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 859b421cbc..1dd6dc444e 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1177,8 +1177,10 @@ function wfLogWarning( $msg, $callerOffset = 1, $level = E_USER_WARNING ) { * @param string $file Filename * @param array $context Additional logging context data * @throws MWException + * @deprecated since 1.25 Use MWLoggerLegacyLogger::emit or UDPTransport */ function wfErrorLog( $text, $file, array $context = array() ) { + wfDeprecated( __METHOD__, '1.25' ); $logger = MWLogger::getInstance( 'wfErrorLog' ); $context['destination'] = $file; $logger->info( trim( $text ), $context ); diff --git a/maintenance/storage/recompressTracked.php b/maintenance/storage/recompressTracked.php index 45cc3396f5..eb7eca18a2 100644 --- a/maintenance/storage/recompressTracked.php +++ b/maintenance/storage/recompressTracked.php @@ -141,7 +141,7 @@ class RecompressTracked { $header .= "({$this->slaveId})"; } $header .= ' ' . wfWikiID(); - wfErrorLog( sprintf( "%-50s %s\n", $header, $msg ), $file ); + MWLoggerLegacyLogger::emit( sprintf( "%-50s %s\n", $header, $msg ), $file ); } /**