> Yeah... I think we're all coming to the same conclusions here..
>
> We just had an internal discussion, and briefly, here's what the results
> were:
>
> Message object is cool. I'll rename it AgaviMessage (avoid stepping
> on toes), build a constructor that'll handle 3 params by default: a
> string (message), an integer (verbosity/log
> level/{INFO,WARN,ERROR,DEBUG}), and another string (destination).
> This destination will be the name of a key in the [loggers] section of
> logging.ini (ie which logger instance to send it to).
Uh oh... the destination doesn't belong there, IMO. A message shouldn't know
where it's being logged, this is what LoggerManager::log() or whatever does,
after all. This would be of great advantage, also for interoperability of
messages. Think about passing one message to multiple loggers, for instance
(although I'm an advocate of the Observer approach, as you know :p)
> We came to the same conclusion you did: there's a lot of value in
> being able to extend the Message class.
>
> We agreed that the Message object would be responsible for translating
> whatever it's logging (be it an object, a string, whatever..) into a
> string, which will then get passed along to the appropriate Logger and
> in-turn the Appender(s).
Why that? It's not flexible!? Maybe I want to "attach" data to the message
or whatever. Translating it is no good. We should just pass the untouched
object to the logger.
> There may still be some hashing to be done as to whether or not to
> make the Logger level use the Observer pattern as you and Mike have
> suggested, but that'll be an easy leap to make once I complete the
> ideas we've outlined in this thread.
Yeah well but it's a different design then. We have two options:
1. (Bob): Tell a message or the logger manager which logger to use
2. (Mike/David): Broadcast messages to all loggers which themselves decide
what to do about the message (process it; discard it).
- David
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev