Improve Debug info presentation

This commit is contained in:
sparkyx 2022-11-17 13:04:15 +01:00
parent 8bf9c4f39e
commit cc55b13538
3 changed files with 20 additions and 16 deletions

View file

@ -8,7 +8,7 @@ class Dbg
public static function echo_var($n_level, $msg)
{
if (DEBUGNOALYSS > $n_level) {
echo '<span style="font-size:12px;color:orangered">';
echo '<span style="font-size:12px;color:orangered;background-color:lightyellow;">';
$type = gettype($msg);
if (in_array($type, ["string", "integer", "double"])) {
echo $msg;
@ -22,10 +22,19 @@ class Dbg
}
}
public static function echo_function($msg)
{
if (DEBUGNOALYSS > 1) {
echo '<span style="font-size:12px;color:lightgreen;background-color:lightyellow;">';
echo "[FILE: $msg]";
echo '</span>';
}
}
public static function echo_file($msg)
{
if (DEBUGNOALYSS > 1) {
echo '<span style="font-size:12px;color:brown">';
echo '<span style="font-size:12px;color:brown;background-color:lightyellow;">';
echo "[FILE: $msg]";
echo '</span>';
@ -120,4 +129,4 @@ EOF;
return $r;
}
}
?>
?>

View file

@ -57,9 +57,8 @@ $selCurrency->selected=$print_operation_currency->getData_operation()->getCurren
if (DEBUGNOALYSS > 1) {
echo "print_operation"; var_dump($print_operation_currency->getData_operation());
}
if ( DEBUGNOALYSS > 1) { echo \Noalyss\Dbg::hidden_info("print_operation ",$print_operation_currency->getData_operation());}
$msg["all"]=_("Aucun filtre");
$msg["by_card"]=_("Par fiche");
@ -174,9 +173,10 @@ $select_box->add_javascript(_("Par catégorie de fiche"),"show_currency_type_sea
<?php
try
{
if (DEBUGNOALYSS > 1) {
echo "SQL = ".$print_operation_currency->getData_operation()->build_SQL();
}
\Noalyss\Dbg::echo_var(1 ,"SQL = ".
$print_operation_currency->getData_operation()->build_SQL());
echo $print_operation_currency->export_html();
}

View file

@ -1,13 +1,8 @@
<?php
//This file is part of NOALYSS and is under GPL
//see licence.txt
if (DEBUGNOALYSS > 1 ) {
echo <<<EOF
<p> LEVEL MENU IS {$level}
access_code {$access_code}
EOF;
// print_r($amenu);
};
\Noalyss\Dbg::echo_var(1,"LEVEL MENU IS {$level} access_code {$access_code}");
?><div class="">
<?php