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.Handler
The 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 boolean
consoleLogging
Flag to enable console logging.private java.io.Writer
writer
A writer to write log records with.private java.lang.Object
writerLock
Lock 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 void
close()
Closes this handler so that it will stop handling log records.void
flush()
Flushes the data that this handler has logged.void
publish(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:
close
in classjava.util.logging.Handler
-
flush
public void flush()
Flushes the data that this handler has logged.- Specified by:
flush
in 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:
publish
in classjava.util.logging.Handler
- Parameters:
record
- TheLogRecord
to publish.
-
-