From: Alexandre Emsenhuber Date: Thu, 2 Feb 2012 16:35:02 +0000 (+0000) Subject: * Always add the hostname in wfDebugLog(), whatever $wgShowHostnames is, since that... X-Git-Tag: 1.31.0-rc.0~24961 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=b6e7b2d9fde9784c52b02cfa19960756a4afa314;p=lhc%2Fweb%2Fwiklou.git * 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 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index b1bd3f2758..78af432edd 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 ); } }