From 6aa3c4fe84ade9a87379abe014b655ac28712f99 Mon Sep 17 00:00:00 2001 From: Bryan Davis Date: Tue, 16 Dec 2014 17:12:23 -0700 Subject: [PATCH] Logging related comment updates * Pretty up some logging related comments. * Send wfDebugLog messages to logger at info level Change-Id: I97b8629095e8d6168dbeb791dfb5e7753d281cbe --- includes/GlobalFunctions.php | 16 ++++++++++------ includes/debug/logger/Logger.php | 5 ++--- .../debug/logger/monolog/LegacyFormatter.php | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 1dd6dc444e..83056c2682 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 ); } /** diff --git a/includes/debug/logger/Logger.php b/includes/debug/logger/Logger.php index 7417c6bdde..c54d2412cc 100644 --- a/includes/debug/logger/Logger.php +++ b/includes/debug/logger/Logger.php @@ -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 diff --git a/includes/debug/logger/monolog/LegacyFormatter.php b/includes/debug/logger/monolog/LegacyFormatter.php index c9545fae1b..67acf57d4a 100644 --- a/includes/debug/logger/monolog/LegacyFormatter.php +++ b/includes/debug/logger/monolog/LegacyFormatter.php @@ -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 -- 2.20.1