LSlog : Added dump feature
authorBenjamin Renard <brenard@easter-eggs.com>
Fri, 19 Nov 2010 17:13:41 +0000 (18:13 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Fri, 19 Nov 2010 17:13:41 +0000 (18:13 +0100)
public_html/includes/functions.php

index 2d15094..9bed394 100644 (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");
     }
   }