Logging related comment updates
authorBryan Davis <bd808@wikimedia.org>
Wed, 17 Dec 2014 00:12:23 +0000 (17:12 -0700)
committerBryan Davis <bd808@wikimedia.org>
Wed, 17 Dec 2014 00:12:23 +0000 (17:12 -0700)
* Pretty up some logging related comments.
* Send wfDebugLog messages to logger at info level

Change-Id: I97b8629095e8d6168dbeb791dfb5e7753d281cbe

includes/GlobalFunctions.php
includes/debug/logger/Logger.php
includes/debug/logger/monolog/LegacyFormatter.php

index 1dd6dc4..83056c2 100644 (file)
@@ -1067,14 +1067,18 @@ function wfDebugMem( $exact = false ) {
 }
 
 /**
- * Send a line to a supplementary debug log file, if configured, or main debug log if not.
- * To configure a supplementary log file, set $wgDebugLogGroups[$logGroup] to a string
- * filename or an associative array mapping 'destination' to the desired filename. The
- * associative array may also contain a 'sample' key with an integer value, specifying
- * a sampling factor.
+ * Send a line to a supplementary debug log file, if configured, or main debug
+ * log if not.
+ *
+ * To configure a supplementary log file, set $wgDebugLogGroups[$logGroup] to
+ * a string filename or an associative array mapping 'destination' to the
+ * desired filename. The associative array may also contain a 'sample' key
+ * with an integer value, specifying a sampling factor. Sampled log events
+ * will be emitted with a 1 in N random chance.
  *
  * @since 1.23 support for sampling log messages via $wgDebugLogGroups.
  * @since 1.25 support for additional context data
+ * @since 1.25 sample behavior dependent on configured $wgMWLoggerDefaultSpi
  *
  * @param string $logGroup
  * @param string $text
@@ -1106,7 +1110,7 @@ function wfDebugLog(
 
        $logger = MWLogger::getInstance( $logGroup );
        $context['private'] = ( $dest === 'private' );
-       $logger->debug( $text, $context );
+       $logger->info( $text, $context );
 }
 
 /**
index 7417c6b..c54d241 100644 (file)
@@ -44,9 +44,8 @@ TXT;
  * change the service provider. If MWLogger::getInstance() is called before
  * any service provider has been registered, it will attempt to use the
  * $wgMWLoggerDefaultSpi global to bootstrap MWLoggerSpi registration.
- * $wgMWLoggerDefaultSpi can either be the name of a class implementing the
- * MWLoggerSpi interface with a zero argument constructor or a callable that
- * will return an MWLoggerSpi instance.
+ * $wgMWLoggerDefaultSpi is expected to be an array usable by
+ * ObjectFactory::getObjectFromSpec() to create a class.
  *
  * @see MWLoggerSpi
  * @since 1.25
index c9545fa..67acf57 100644 (file)
@@ -21,7 +21,7 @@
 /**
  * Log message formatter that mimics the legacy log message formatting of
  * `wfDebug`, `wfDebugLog`, `wfLogDBError` and `wfErrorLog` global functions by
- * deligating the formatting to MWLoggerLegacyLogger.
+ * delegating the formatting to MWLoggerLegacyLogger.
  *
  * @since 1.25
  * @author Bryan Davis <bd808@wikimedia.org>