[squeak-dev] Logging from the Compiler

Colin Putney colin at wiresong.com
Thu Dec 12 01:26:33 UTC 2013


On Sun, Dec 8, 2013 at 5:46 PM, Frank Shearar <frank.shearar at gmail.com>wrote:

> Compiler depends on System because changing stuff - adding methods,
> changing classes, etc. - sends messages to SystemChangeNotifier
> uniqueInstance.
>
> While convenient, it (a) is inflexible and (b) causes a cycle. The
> correct relationship is that System uses Compiler.
>
> With that in mind, _a_ solution to this problem is to log things
> through a callback/registration mechanism of some kind. If you care
> about logging, you create a Compiler, say "log here" and off you go.
> (This means that you remove the log: part of a lot of methods in
> Compiler - if you don't have a logger/loggers attached, nothing
> happens, rather than logThis ifTrue: [] blocks. (Because you by
> default have a null logger.))
>
> Thoughts? Other possible approaches?
>

One thing we ought to do is look at what Pharo has done here. IIRC, they
got rid of SystemChangeNotifier, and use Announcements instead. That might,
or might not, solve the problem at hand, but it if it does, compatibility
would be a plus, and it's probably less work than coming up with something
new.

Colin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20131211/9c37b056/attachment.htm


More information about the Squeak-dev mailing list