Login   Register  
PHP Classes
elePHPant
Icontem

Great Tool

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Debug_Logging  >  All threads  >  Great Tool  >  (Un) Subscribe thread alerts  
Subject:Great Tool
Summary:Never use echo for debugging again!
Messages:3
Author:Tyler
Date:2010-10-28 12:40:50
Update:2010-11-02 12:27:51
 

  1. Great Tool   Reply   Report abuse  
Picture of Tyler
Tyler
2010-10-28 12:40:54
I will never resort to outputting debug messages via the Webbrowser with print() or echo(), this class makes it very easy to write debug messages straight to the data system and follow what is happening in your code!

  2. Re: Great Tool   Reply   Report abuse  
Picture of Yongchen Xu
Yongchen Xu
2010-10-28 21:50:40 - In reply to message 1 from Tyler
How to do it in detail?

  3. Re: Great Tool   Reply   Report abuse  
Picture of Tyler
Tyler
2010-11-02 12:27:51 - In reply to message 2 from Yongchen Xu
very easy:

you include the class and create the object:

include_once(dirname(__FILE__).'/../classes/debug_logging.class.php');
GLOBALS["DBG"] = new Debug_Logging(true, 'some filename', false);

then use the logging calls in your code:
$GLOBALS["DBG"]->info("Test message of the type DEBUG");
$GLOBALS["DBG"]->debug("Test message of the type DEBUG");
$GLOBALS["DBG"]->debug2("Test message of the type DEBUG2");
$GLOBALS["DBG"]->debug_array("Test message of the type DEBUG_ARRAY", $an_array);
$GLOBALS["DBG"]->debug2_array("Test message of the type DEBUG2_ARRAY", $an_array);

For further information take a look at the "test/01_test_debug_loggind.class.php" file.