--- projects/cms/source/server/uk/org/iscream/cms/server/core/loggers/SimpleSwingLogger.java 2001/02/25 20:34:17 1.6 +++ projects/cms/source/server/uk/org/iscream/cms/server/core/loggers/SimpleSwingLogger.java 2001/02/25 20:49:20 1.7 @@ -25,7 +25,7 @@ import java.awt.Color; * specify if this enforces the max rows, but I THINK it does. * * @author $Author: tdb $ - * @version $Id: SimpleSwingLogger.java,v 1.6 2001/02/25 20:34:17 tdb Exp $ + * @version $Id: SimpleSwingLogger.java,v 1.7 2001/02/25 20:49:20 tdb Exp $ */ public class SimpleSwingLogger extends JFrame implements LoggerImpl { @@ -34,7 +34,7 @@ public class SimpleSwingLogger extends JFrame implemen /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.6 $"; + public final String REVISION = "$Revision: 1.7 $"; private final int width = 700; private final int height = 400; @@ -87,17 +87,18 @@ public class SimpleSwingLogger extends JFrame implemen //---PUBLIC METHODS--- /** - * The write() method takes a message, formats it using the - * formatLogLine() method, and then outputs it to the screen - * using the text area. The source is usually the - * calling object, referenced by `this'. The method has been - * made synchronized to avoid it being called by two different - * objects and the output ending up merged on the screen. - * - * @param source A string representation of the calling object. - * @param verbosity the verbosity of this message - * @param message The text to be logged. - */ + * The write() method takes a line of text, pre-formatted + * and outputs it using a method defined by the actual + * implementation. The verbosity is given in case the + * implementation wishes to utilise it in the layout - + * eg. a different colour or font. + * + * This instance writes the line to a Swing based GUI + * logger. + * + * @param line A line of formatted text to be logged + * @param verbosity the verbosity of this message + */ public synchronized void write(String line, int verbosity) { _textArea.insert(line + "\n",0); _textArea.setRows(_maxMessages); @@ -121,6 +122,14 @@ public class SimpleSwingLogger extends JFrame implemen //---PRIVATE METHODS--- + /** + * This method is provided if this class wishes to log + * a message itself. + * + * @param source A String representation of the source + * @param verbosity the verbosity of this message + * @param message The message to log + */ private void write(String source, int verbosity, String message) { write(FormatName.formatLogLine(source, verbosity, message), verbosity); }