help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Re: Logging facility for GNU-smalltalk


From: Joachim Jaeckel
Subject: [Help-smalltalk] Re: Logging facility for GNU-smalltalk
Date: Fri, 10 Jul 2009 19:51:16 +0200
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

I think for me the OutputHandler is indeed the combination of your LogHandler and a formatter, with the difference that Transcript, file, etc. for me are all realized with the same kind of LogHandler; possibly created with different class methods.

Aha.

 > logHandler log: (formatter format: logEntry).

The problem with this is that in some cases the LogHandler might need the severity and category, as is the case for syslog (and I expect special handling of date/time in some cases might be desirable, for example to put a limit on the number of messages per second).

Ok, seems reasonable, what about
logHandler log: LogEntry formattedMsg: (formatter format: logEntry).

So you have all the data like category, severity, date and time available to the logHandler.

It could be done entirely with a MultiplexOutputHandler that also takes care about filtering unwanted severities, yes.

filtering unwanted severities is currently done in the logger itself (which is the only class with a bit of logic) because the Dictionary for the channel holds the output-severity for this channel. The other classes (LogHandler and Formatter) are really dumb and plugable to the channel.

I thought about moving the channel-handling in a seperate class, that makes the responsibility a bit clearer, that the channel-handler is also responsable for the output-severity of this channel... but than, I decided to keep this little logic also in the logger itself instead of creating an additional step of communication to the log-output.

...maybe I should change that...

And the MultiplexOutputHandler sounds to me like my Logger, with the difference, that you format the message only once and redirect it to the several available streams.


Regards,
Joachim.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]