From: Antoine Musso Date: Fri, 7 Dec 2012 15:50:58 +0000 (+0100) Subject: prefix debug log when they end up in the main log X-Git-Tag: 1.31.0-rc.0~21377^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=e32c8afe54367aa5d0b33f8b00d4f4c88838ebfe;p=lhc%2Fweb%2Fwiklou.git prefix debug log when they end up in the main log Whenever we use wfDebugLog( "group", "message" ); and "group" is not also set in $wfDebugLogGroups, the group information is lost. By prefixing the message with the group name, it makes it obvious where the message comes from. Example output: ... [EventLogging] wgEventLoggingSchemaIndexUri has not been configured. [EventLogging] EventLogging requires memcached, and no memcached[...] Fully initialised Profiler::instance called without $wgProfiler['class'] set[...] Connected to database 0 at MessageGroups::init-nocache SQL ERROR (ignored): no such table: revtag_type MessageGroups::loadGroupDefinitions-end [ContentHandler] Created handler for wikitext: WikitextContentHandler [ContentHandler] Created handler for javascript: JavaScriptContentHandler ... Change-Id: Id75401bec516b5111cd1e3d4a9b29843953ce12b --- diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 220089d50e..87a0058f15 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -57,6 +57,9 @@ production. debug mode: wfMsg, wfMsgNoTrans, wfMsgForContent, wfMsgForContentNoTrans, wfMsgReal, wfMsgGetKey, wfMsgHtml, wfMsgWikiHtml, wfMsgExt, wfEmptyMsg. Use the Message class, or the global method wfMessage. +* Debug message emitted by wfDebugLog() will now be prefixed with the group + name when its logged to the default log file. That is the case whenever the + group has no key in wgDebugLogGroups, that will help triage the default log. === Bug fixes in 1.21 === * (bug 40353) SpecialDoubleRedirect should support interwiki redirects. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 6d86a5047c..7833a71f06 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1037,7 +1037,7 @@ function wfDebugLog( $logGroup, $text, $public = true ) { wfErrorLog( "$time $host $wiki: $text", $wgDebugLogGroups[$logGroup] ); } } elseif ( $public === true ) { - wfDebug( $text, true ); + wfDebug( "[$logGroup] $text", true ); } }