View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}

{zone-data:component-name}
Zend_Log
{zone-data}

{zone-data:proposer-list}
[Art Hundiak|mailto:dev@zayso.org]
{zone-data}

{zone-data:revision}
1.1 - 27 June 2006: Initial Proposal.
{zone-data}

{zone-data:overview}
It is proposed that the existing static Zend_Log class be changed into a fully dynamic logging class. This proposal is being submitted based on some of the traffic on the mailing list as well as some off line conversations.
{zone-data}

{zone-data:references}
* [PEAR Log|http://www.indelible.org/pear/Log/guide.php]
{zone-data}

{zone-data:requirements}
For many applications the need for a logging class is self evident. The existing static Zend_Log class covers this need rather nicely but suffers from the usual static class limitations i.e. it is difficult to add functionality and can be difficult to use in a testing enviroment.
{zone-data}

{zone-data:dependencies}
Pretty much the same as the existing Zend_Log class.
{zone-data}

{zone-data:operation}
{code}
$log = new Zend_Log();
$log->registerLogger(new Zend_Log_Adapeter_File('log_file.txt');
$log->log('A Message');
{code}
In most cases the log class would be accessed via the registry. I would suggest having static getInstance(),setInstance(),hasInstance() methods to allow low level code access to one instance of the logging class without the need to go through the registry.
{zone-data}

{zone-data:class-list}
* Zend_Log
* Zend_Log_Interface
* Zend_Log_Exception
* Zend_Log_Adapter (existing adapter classes)
{zone-data}

{zone-data:use-cases}
{zone-data}

{zone-data:skeletons}
I'm not going to propose skeleton details until I see how the proposal is received. I think the existing class covers most of the standard required functionality so it's basically a question of refactoring the code to remove the statics and maybe adding a params array to the constructor. If someone else has strong opinions on what the class needs then I'm more than willing to either work with them or to turn the entire proposal over to them.
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>