help-smalltalk
[Top][All Lists]
Advanced

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

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


From: vranyj1
Subject: Re: [Help-smalltalk] Logging facility for GNU-smalltalk
Date: Thu, 09 Jul 2009 16:57:01 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.3.4)

Hello,

it seems that there is plenty of logging tools for Smalltalk.
We have created our own called Loggia
(public SVN http://smalltalk.felk.cvut.cz/svn/stx/goodies/loggia,
written for Smalltalk/X) and at ESUG 2007 in Lugano somebody
presents another logging tool - unfortunately I forgot the name,
but it was for VW and should be in public repository.

Looking at the documentation, all three tools are designed
in pretty same way.

Happy logging :-) Jan

Cituji Joachim Jaeckel <address@hidden>:

Hello,

in the last week, I created a small logging facility which could be used with GNU-smalltalk. (Because I haven't found something like the logging api from Java for Smalltalk and I was tired using 'xyz' printNl's. ...)

I don't know, if you have a usage for it, or if you in generall interested in it, but please allow me to describe it a little bit.

--

For reading the bit of documentation, please visit:
http://www.joachim-jaeckel.de/redmine/wiki/log4gst

For the case, you would like to download it, try:
svn co svn://www.joachim-jaeckel.de/repos/log4gst/trunk Logging


It consists of a LogManager, which is available via Log4Gst.LogManager instance. It's implemented as a singleton, so there's only one instance in a smalltalk-vm.

This LogManager can handle different instances of loggers (available via logManager logger: 'CategoryXYZ'). These loggers are identified through category-names. (The idea behind is, that e.g. if you have several different applications running in the same vm, that every application could have it's own logger...)

Each logger itself can have different output "channels", these "channels" could be constructed via an output-handler (like a transcript-output-handler or a file-output-handler) and a special formatter (like a text-formatter or a html-formatter).

This gives you the possiblity, to log directly with a text-format to the transcript and parallel in html-format to an html-file. Or you could subclass your own output-handler and formatter and provide some completely new outputs and formats of the messages.

There exists 6 different kind of messages, which could be printed. (SEVERE, WARNING, INFO, FINE, FINER, FINEST). (Additionally, there are defined NONE and ALL, where ALL means the same as FINEST...)

For the logger and for every configured channel, you can set the output-severity of them independently. The severity which could be set for the logger itself, controls the output of messages, which should be printed in general through this logger. The severity which could be set for each channel, controls the output of messages, which should be printed through this channel.

A log-message is automatically enhanced by the category of the logger, the date and time of printing the log-message, and the class and method-name, from which the logging is called. Of course, you can control the information which is printed through several different implementations of the different formatters, or write your own one.

Best regards,
Joachim.


_______________________________________________
help-smalltalk mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-smalltalk








reply via email to

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