diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a489c42259..dcac6573a8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2009-09-18 Miguel de Dios + + * include/functions_html.php: add second parameter for trace a log in server + file (plain text). + 2009-09-18 Miguel de Dios * godmode/agentes/module_manager.php: add checkbox to multiple delete diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index f4bfd99a10..b1c5777d6d 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -22,8 +22,22 @@ /** * Prints the print_r with < pre > tags */ -function debugPrint ($var) { - echo "
";print_r($var);echo "
"; +function debugPrint ($var, $file = '') { + if ($file === true) + $file = '/tmp/logDebug'; + if (strlen($file) > 0) { + $f = fopen($file, "a"); + ob_start(); + echo date("Y/m/d H:i:s") . "\n"; + print_r($var); + echo "\n\n"; + $output = ob_get_clean(); + fprintf($f,"%s",$output); + fclose($f); + } + else { + echo "
";print_r($var);echo "
"; + } }