On 07/10/2009 07:51 PM, Joachim Jaeckel wrote:
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.
Then why don't you move the formatter instance variable to the logHandler?
...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.
Indeed. The idea of decorators is exactly to move stuff out of the
logger to its users by putting some other output handler between the
logger and what actually writes the output. The decorator can do
filtering but otherwise delegates the output to the leaf.
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk