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: Paolo Bonzini
Subject: [Help-smalltalk] Re: Logging facility for GNU-smalltalk
Date: Fri, 10 Jul 2009 20:10:28 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

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




reply via email to

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