On 6/30/05, Bob Zoller <[EMAIL PROTECTED]> wrote:
> $msg = new Message();
> $msg->setParameter('message', 'this is my message');
> $msg->setParamter('p', 5000); //this is my priority
> $logger = LoggingManager::getLogger();
> $logger->log($msg);

gadzooks! 

> 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));

I know you and I have discussed this between ourselves quite a bit. I
still think the overall design of the logging is overly complicated. I
started working on tests/code in your branch to illustrate why I think
it's overly complicated, or rather how much simpler it could be.

LoggingManager, simply manages loggers and passes them events to log
Logger, this is an event handler that registers itself with the LoggingManager

LoggingManager::log(event, priority=somedefault) passes the event to
all the registered loggers

the logger takes the event and does whatever it wants with it, appends
it to a file, sends it in an email to someone, saves it to a db, etc..

I should probably make a better study of other logging systems out
there, but I didnt think it really needed to be very complicated.

-Mike
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev

Reply via email to