Hello graeme,
Tuesday, August 9, 2005, 2:11:30 PM, you wrote:
>
> Agavi Logging
> As a proof of concept I have put together some code for logging. The point
> of this is to form the
> basis of discussion, it is not sufficiently robust to enter the
> framework 'as is'. However it does (I
> believe) provide sufficient functionality to be the basis of discussion.
> There is nothing particularly special about the code, I have tried to follow
> the essence of the
> framework, however it does lack proper error checking (exceptions) unit
> tests are missing, no
> proper docs and the actual logging functionality is missing
> rather the logging just goes to the
> screen. The main reason for these deficiencies is because I wanted to focus
> on the concept and get
> feedback on that first.
That's OK.
> Framework classes
> The framework classes used are as follows:
> LoggerManager This singleton class will manage the logger objects
> LoggingConfigHandler This class will extract the information form the *.ini
> file.
> Logger This class is an abstract class that provides the basic
> logging functionality. It will check if it needs to respond to a log request.
> FileLogger, EmailLogger and HTMLLogger These are child classes of
> Logger. These classes will write out the log to the appropriate
> location NOT IMPLEMENTED at the moment it will just echo out the message.
Hmm... built on the Observer pattern I guess. But do we really need
the LoggingConfigHandler? Can't it be made a part of LoggerManager?
> Using the classes
> The LoggerManager object can be set up in the index.php file,
> meaning that the logging can be used
> almost immediately. It can be set up once the agavi.php file has been
> included.
> The config_handlers.ini file has been modified to include a logging.ini
> entry.
> A logging.ini file is included
> I then tested it with the following line of code in the
> IndexAction, of the Default module.
> LoggerManager::write("Error in handleError() method of
> IndexAction.class.php",HIGH);
> Conclusion
> This is essentially presented to you all for comments.
I've yet to look at the code... But really this is a good way of
implementing Logging.
--
Best regards,
Amol mailto:[EMAIL PROTECTED]
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev