* Always add the hostname in wfDebugLog(), whatever $wgShowHostnames is, since that...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 2 Feb 2012 16:35:02 +0000 (16:35 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 2 Feb 2012 16:35:02 +0000 (16:35 +0000)
* Use wfHostname() and wfWikiId() instead of executing "hostname" command and $wgDBname respectively for consistency

includes/GlobalFunctions.php

index b1bd3f2..78af432 100644 (file)
@@ -947,16 +947,12 @@ function wfDebugMem( $exact = false ) {
  *                     log file is specified, (default true)
  */
 function wfDebugLog( $logGroup, $text, $public = true ) {
-       global $wgDebugLogGroups, $wgShowHostnames;
+       global $wgDebugLogGroups;
        $text = trim( $text ) . "\n";
        if( isset( $wgDebugLogGroups[$logGroup] ) ) {
                $time = wfTimestamp( TS_DB );
                $wiki = wfWikiID();
-               if ( $wgShowHostnames ) {
-                       $host = wfHostname();
-               } else {
-                       $host = '';
-               }
+               $host = wfHostname();
                if ( wfRunHooks( 'Debug', array( $text, $logGroup ) ) ) {
                        wfErrorLog( "$time $host $wiki: $text", $wgDebugLogGroups[$logGroup] );
                }
@@ -973,8 +969,9 @@ function wfDebugLog( $logGroup, $text, $public = true ) {
 function wfLogDBError( $text ) {
        global $wgDBerrorLog, $wgDBname;
        if ( $wgDBerrorLog ) {
-               $host = trim(`hostname`);
-               $text = date( 'D M j G:i:s T Y' ) . "\t$host\t$wgDBname\t$text";
+               $host = wfHostname();
+               $wiki = wfWikiID();
+               $text = date( 'D M j G:i:s T Y' ) . "\t$host\t$wiki\t$text";
                wfErrorLog( $text, $wgDBerrorLog );
        }
 }