I've been working to implement logging recently. So far, I'm happy
with what Sean (feti) started. For the most part, I've only filled in
the missing code.
Yesterday, I stumbled across the Message object. Apparently, Sean was
thinking you'd create a Message object and then pass that into the
Logger. The Message object extends ParameterHolder, so you'd
basically end up calling setParamter() etc.. before passing it on to
the logging methods..
something like:
$msg = new Message();
$msg->setParameter('message', 'this is my message');
$msg->setParamter('p', 5000); //this is my priority
$logger = LoggingManager::getLogger();
$logger->log($msg);
What I'm wondering is this: do we really need the Message object?
Might we all just agree that when you want something logged, it
consists of a) the message (string) and b) a priority or level
(integer) ? If so, we could do something like:
$logger = LoggingManager::getLogger();
$logger->log('this is my message', 5000);
- or even -
LoggingManager::log('this is my message', 5000);
- or -
LoggingManager::log('this is my message', 5000, 'alternativelogger');
If enough of us decide keeping the Message object is the way to go,
might I suggest this as our first class to actually utilize
__construct().. so we can at least do:
LoggingManager::log(new Message('this is my message', 5000));
Feedback appreciated!
--Bob
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev