noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 03/30: Improve Debug info presentation


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 03/30: Improve Debug info presentation
Date: Sat, 3 Dec 2022 08:35:06 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit cc55b135383ca1e6ffbca058d9c539474bbafcbc
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Thu Nov 17 13:04:15 2022 +0100

    Improve Debug info presentation
---
 include/lib/dbg.php              | 15 ++++++++++++---
 include/print_currency01.inc.php | 12 ++++++------
 include/template/menu.php        |  9 ++-------
 3 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/include/lib/dbg.php b/include/lib/dbg.php
index 5b6425853..e17af5121 100644
--- a/include/lib/dbg.php
+++ b/include/lib/dbg.php
@@ -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;
     }
 }
-?>
\ No newline at end of file
+?>
diff --git a/include/print_currency01.inc.php b/include/print_currency01.inc.php
index 62cc5e6e4..c2739b7d1 100644
--- a/include/print_currency01.inc.php
+++ b/include/print_currency01.inc.php
@@ -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();
         
     }
diff --git a/include/template/menu.php b/include/template/menu.php
index 3d2756ad4..55567578e 100644
--- a/include/template/menu.php
+++ b/include/template/menu.php
@@ -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 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]