LSlog : Added dump feature

This commit is contained in:
Benjamin Renard 2010-11-19 18:13:41 +01:00
parent 711f95b446
commit dc5b3b44d1

View file

@ -436,12 +436,18 @@ function LSdebugDefined() {
return 1;
}
function LSlog($msg) {
function LSlog($msg,$dump=false) {
if ($GLOBALS['LSlog']['enable']) {
global $LSlogFile;
if (!$LSlogFile) {
$LSlogFile=fopen($GLOBALS['LSlog']['filename'],'a');
}
if ($dump) {
$msg=varDump($msg);
}
else if (is_array($msg)||is_object($msg)) {
$msg = print_r($msg,true);
}
fwrite($LSlogFile,$_SERVER['REQUEST_URI']." : ".$msg."\n");
}
}