Re: Re: [Log class] Problem when Logging into a database
| From: | Jon Parise | Date: | Thu, 28 Nov 2002 17:03:57 +0000 |
| Subject: | Re: Re: [Log class] Problem when Logging into a database | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-11234@lists.php.net to get a copy of this message | ||
On Thu, Nov 28, 2002 at 04:40:30PM +0100, Frederic Poeydomenge wrote:
> 1) in Log/sql.php
>
> function close() should not close the connection if an existing database
> connection was provided, but in that case you should let the calling program
> manage itself the connection ?
Yes, that makes sense. I'll take care of this in a few minutes.
> 2) in Log.php :
> function log($message, $priority = LOG_INFO)
> should be :
> function log($message, $priority = PEAR_LOG_INFO)
>
> using the 'PEAR_' prefix as in others classes (mail, console...)
>
>
> 3) in Log/file.php, same problem :
> function Log_File($name, $ident = '', $conf = array(), $maxLevel =
> LOG_DEBUG)
> should be :
> function Log_File($name, $ident = '', $conf = array(), $maxLevel =
> PEAR_LOG_DEBUG)
I must have missed those two when I made the global change a few
releases back. They're both fixed now.
> 4) Why is there the following difference : in file.php, lines are stored in a
> buffer (_logLines) and then printed out by the destructor, but in sql.php, lines
> are inserted directly into the database without any buffering... Is there a
> reason to have two such different ways to compute the data ?
The file handler was rewritten to use PEAR's destructor mechanism,
which allows for the buffering that you describe above. The SQL
handler was never updated to use a destructor, so it doesn't perform
buffering.
Feel free to submit a patch to add buffering to the SQL handler.
--
Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)