phpgroupware-developers
[Top][All Lists]
Advanced

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

Re: [Phpgroupware-developers] A Logging Proposal (long)


From: Chris Weiss
Subject: Re: [Phpgroupware-developers] A Logging Proposal (long)
Date: Thu, 02 Oct 2003 20:19:07 +0000

Doug Dicks (address@hidden) wrote:

First, excelent write of the way it currenlty works!  i didn't even know this
exsisted in such an easy way to use before now.

>Questions I Have:
>
>First, the big question:
>
>1) Is this something the team is interested in incorporating into the
>base PHPGroupware?

well, most of the work seems to be already done, so I'd say yes

>
>2) Is having the file name and line number useful?

Sometimes it is.  Some can easily be repeated among extended classes, nice to 
know
where the message is /really/ comming from.  However, making them optional 
would be
fine.

>Getting rid of it makes it possible to get rid of the array completely
>and just have the developer pass in a message.  Parameters to be
>substituted can be passed in additional args that default to 'noarg'.
>Then the logging calls change from
>
>log_debug(array('text' => 'Variable x is %1',
>  'p1' => $x,
>  'file' => __FILE__,
>  'line' => __LINE__));
>
>to
>
>log_debug('Variable x is %1', $x);
>
>Much, much easier to put write, which means it's much more likely to get
>used.

Would be easy to do this using func_get_args() and if the first arg is an array 
use
the old style, otherwise use the newer simple style.

>3) Should I use print_r on the parameters before substituting them?

only if it's running under php 4.3 or newer.  For 4.2 and newer, var_export is
interesting.  Possibly even just serialize it so the array/object can be 
copy/pasted
for test script recreation.  i typicaly print_r things, but that's not easy to
capture pre-4.3 and most people are still using pre-4.3.

>4) Should I include options to write logging messages to standard output
>as viewable HTML or/and within comments?

Check how email does this.  It puts the contents in a popup window, kinda cool.





reply via email to

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