Log Package || Changes/Updates/Suggestions

From: Date: Sun, 16 Mar 2003 18:05:09 +0000
Subject: Log Package || Changes/Updates/Suggestions
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-14338@lists.php.net to get a copy of this message
The following is an email I sent to the Log package maintainer, but as I never heard a response back I figured I would send it to the whole list. === The changes can be found in Log.php and file.php because they are the classes I used in one of my projects. I realize that the changes are extensive and will break old code, however I think they are quite important for future development. If these fixes seem acceptable I would happily make them to the rest of the Log_* classes. I am extremely interested in helping with this package and it's future is important to one of my employer’s big projects. The new Log package and all of the *diff files are attached. I would also like to make a Log_html or possibly Log_xml class for easy browser viewing, but since it is so closely related to Log_file I was wondering if there should be one more parameter passed in to control it's output between text and HTML/XML. This might also be a nice feature to implement in the base Log class as it could definitely benefit the other methods of logging. Any opinion? I would greatly appreciate your consideration of the code, thank you for your time. ~ Matthew Metnetsky ==== Changes ==== - Log_file destructor duplicates the code in writeOut() ++ now destructor calls writeOut() ++ - Log_file doesn't actually extend Log because Log() constructor is never called, just $this->PEAR() constructor. As a result the Log_file's destructor does not work. ++ Log_file now extends by calling $this->Log() and $this->_Log() inside the Log_* destructor. This makes variables and methods actually inherited from the base class, so they don't need to be rewritten in Log_file. Destructor now works because of the hierarchy => PEAR()->Log()->Log_file() ++ - The above fix creates a problem with Log() constructor and log() method because PHP recognizes them as the same. ++ Renamed log() to appendLog() as it seems a more fitting name (sadly this breaks old code, but you need this change to truly extend Log(). ++ - moved lots of generic Log methods/variables out of Log_file and into Log for a more straight for OO design. - priorityToString() returns capitalized messages to stand out. - other things that currently escape me. -- Matthew Metnetsky mimetnet@syr.edu

Attachment: [application/x-gzip] Log-package-updates.tgz
« previous php.pear.dev (#14338) next »