Package net.sf.freecol.common.logging
Class DefaultHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- net.sf.freecol.common.logging.DefaultHandler
-
public final class DefaultHandler extends java.util.logging.HandlerThe default handler for FreeCol's log records. It currently only logs to a file in the format offered by TextFormatter.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanconsoleLoggingFlag to enable console logging.private java.io.WriterwriterA writer to write log records with.private java.lang.ObjectwriterLockLock for the writer.
-
Constructor Summary
Constructors Constructor Description DefaultHandler(boolean consoleLogging, java.io.Writer writer)The constructor to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this handler so that it will stop handling log records.voidflush()Flushes the data that this handler has logged.voidpublish(java.util.logging.LogRecord record)Publishes the given LogRecord by writing its data to a file using a TextFormatter.
-
-
-
Method Detail
-
close
public void close()
Closes this handler so that it will stop handling log records.- Specified by:
closein classjava.util.logging.Handler
-
flush
public void flush()
Flushes the data that this handler has logged.- Specified by:
flushin classjava.util.logging.Handler
-
publish
public void publish(java.util.logging.LogRecord record)
Publishes the given LogRecord by writing its data to a file using a TextFormatter.- Specified by:
publishin classjava.util.logging.Handler- Parameters:
record- TheLogRecordto publish.
-
-