r110591 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110590‎ | r110591 | r110592 >
Date:16:35, 2 February 2012
Author:ialex
Status:ok
Tags:core 
Comment:
* Always add the hostname in wfDebugLog(), whatever $wgShowHostnames is, since that setting is for user display, not internal stuff
* Use wfHostname() and wfWikiId() instead of executing "hostname" command and $wgDBname respectively for consistency
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -947,16 +947,12 @@
948948 * log file is specified, (default true)
949949 */
950950 function wfDebugLog( $logGroup, $text, $public = true ) {
951 - global $wgDebugLogGroups, $wgShowHostnames;
 951+ global $wgDebugLogGroups;
952952 $text = trim( $text ) . "\n";
953953 if( isset( $wgDebugLogGroups[$logGroup] ) ) {
954954 $time = wfTimestamp( TS_DB );
955955 $wiki = wfWikiID();
956 - if ( $wgShowHostnames ) {
957 - $host = wfHostname();
958 - } else {
959 - $host = '';
960 - }
 956+ $host = wfHostname();
961957 if ( wfRunHooks( 'Debug', array( $text, $logGroup ) ) ) {
962958 wfErrorLog( "$time $host $wiki: $text", $wgDebugLogGroups[$logGroup] );
963959 }
@@ -973,8 +969,9 @@
974970 function wfLogDBError( $text ) {
975971 global $wgDBerrorLog, $wgDBname;
976972 if ( $wgDBerrorLog ) {
977 - $host = trim(`hostname`);
978 - $text = date( 'D M j G:i:s T Y' ) . "\t$host\t$wgDBname\t$text";
 973+ $host = wfHostname();
 974+ $wiki = wfWikiID();
 975+ $text = date( 'D M j G:i:s T Y' ) . "\t$host\t$wiki\t$text";
979976 wfErrorLog( $text, $wgDBerrorLog );
980977 }
981978 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r110631Follow-up r110591: remove unused global declarationialex23:01, 2 February 2012

Status & tagging log