[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Logging facility for GNU-smalltalk
From: |
Joachim Jaeckel |
Subject: |
[Help-smalltalk] Logging facility for GNU-smalltalk |
Date: |
Mon, 06 Jul 2009 00:54:28 +0200 |
User-agent: |
Mozilla-Thunderbird 2.0.0.19 (X11/20090103) |
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] Logging facility for GNU-smalltalk,
Joachim Jaeckel <=
- Re: [Help-smalltalk] Logging facility for GNU-smalltalk, Paolo Bonzini, 2009/07/07
- Re: [Help-smalltalk] Logging facility for GNU-smalltalk, Joachim Jaeckel, 2009/07/08
- Re: [Help-smalltalk] Logging facility for GNU-smalltalk, Paolo Bonzini, 2009/07/08
- Re: [Help-smalltalk] Logging facility for GNU-smalltalk, Joachim Jaeckel, 2009/07/08
- Re: [Help-smalltalk] Logging facility for GNU-smalltalk, Paolo Bonzini, 2009/07/08
- Re: [Help-smalltalk] Logging facility for GNU-smalltalk, Stefan Schmiedl, 2009/07/08
- Re: [Help-smalltalk] Logging facility for GNU-smalltalk, Paolo Bonzini, 2009/07/09