phpgroupware-developers
[Top][All Lists]
Advanced

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

RE: [Phpgroupware-developers] Proposal - Debug Handling


From: Kai Hofmann
Subject: RE: [Phpgroupware-developers] Proposal - Debug Handling
Date: Mon, 14 Jul 2003 09:57:34 +0200

> Debgugging
> Debug mode is a real mess.  I have seen it implemented so 
> many different
> ways.  $this->debug = bool, $this->debug = int, $DEBUG=bool,
> $GLOBALS[$DEBUG]=bool, $DEBUG=int etc.  The handling of this is also a
> little all over the place, some code echos, some uses 
> _debug_array.  The
> handling is a less of an issue imho.
> 
> What I would propose is that we use
> $GLOBALS['phpgw_info']['flags']['debug'] = int (0-5)
> 
> This would allow a global debug mode, with more granuality.
> 
> Here is the scale
> 0 (or undefined) - Nothing
> 1 - Only Major things
> ...
> 3 - Most stuff
> ...
> 5 - Everything (ie every db->Record array is pumped through
> _array_debug) - rarely used
> 
> We already have the print_debug method in common_functions, which
> supports a level.  I think some minor changes there would 
> make this very
> easy to implement.
> 
> The main chage is dropping distinguishing api and app 
> debugging and also
> using a global variable instead of a constant.
> 
> What do people think?


I agree with you.
But a better way for debugging would be to use log4php

http://www.vxr.it/log4php/ 


because log4... is now a powerful standard for many different
programming languages.

Greetings

   Kai




reply via email to

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