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

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


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.


THANKS for all the input, and have a happy 4th of July weekend to
those that celebrate it ;)
--Bob


At this point I think I've got enough input to finish this up, and I
will attempt to do so this weekend.



On 7/1/05, David Zülke <[EMAIL PROTECTED]> wrote:
> > On 7/1/05, Bob Zoller <[EMAIL PROTECTED]> wrote:
> > > LoggingManager::log('my message', 5000);  // log to the default logger
> > > LoggingManager::log('my message', 5000, 'otherns'); // log to the
> > otherns logger
> >
> > This is my gripe with this. I dont want to need to know what loggers
> > are configured. I want to log a message and let the loggers (ALL of
> > them) do what they want with it, if anything. I dont want to have half
> > a dozen calls to the logging manager everywhere I want to log things..
> > etc. That's the beauty of the observer pattern, you dont need to think
> > about who's watching the events.
> 
> Exactly my thoughts, Mike!
> 
> 
> > > That seem like it'll handle what you're wanting to do David?  The
> > > question still remains, do we:
> > >
> > > LoggingManager::log('my message', 5000, 'otherns');
> > >
> > > -or-
> > >
> > > LoggingManager::log(new Message('my message', 5000), 'otherns');
> >
> > I think though, if this is to be the approach, the 'otherns' would be
> > encapsulated in the msg object as well, that way your method signature
> > isnt subject to changes in what we are actually passing around. So..
> > there is at least one benefit to encapsulating the event. :)
> >
> > Thinking about in those terms, that seems more appealing now.
> >
> > -Mike
> >
> > -1 Direct interaction with logger objs
> > +1 Msg Object
> 
> I don't think we really need the Message Object... If we do it that way,
> tho, we'd pass the object to the loggers, right? That way, everybody could
> implement his own custom functionality (so I could have a third parameter
> for the CustomMessage constructor that gets the namespace. Cool.)... hmh...
> maybe I'm +1 Message Object, too ;)
> 
> - David
> 
> 
> _______________________________________________
> agavi-dev mailing list
> [email protected]
> http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev
>
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev

Reply via email to