note 13803 deleted from pear.standards.comments by philip
| From: | philip@php.net | Date: | Fri, 31 Aug 2001 16:10:31 +0000 |
| Subject: | note 13803 deleted from pear.standards.comments by philip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17437@lists.php.net to get a copy of this message | ||
About debug information - This is (in a short) what I do:
<?php
define("VERBOSE",_1);
$A_DEBUG_=_array();_//_global,_set_by_debug(),_displayed_via_show_debug()
function_DEBUG($msg)
{
____global_$A_DEBUG;_//_is_an_array
____if_(VERBOSE)_$A_DEBUG[]_=_$msg;_//_adding
}_//_DEBUG()
function_SHOW_DEBUG
{
____global_$A_DEBUG;_//_is_an_array
____if_(VERBOSE)_print_r($A_DEBUG);
}_//_SHOW_DEBUG
DEBUG("started");
LOT_OF_CODE();
DEBUG("finished");
SHOW_DEBUG();
?>
If I don't need debug-information any longer I just delete all lines containing
"DEBUG". I use uppercase, because lines containing "debug" will stay untouched
(p.e. comments).
--
BTW
Why write "if" and "{" in a single line and "function" and
"{" not?
I for myself put "{" and "}" in a line without any other code before or after -
except comments after "}".
Stay cool, don't close the fridge.