net.i2p.util
Class LogWriterBase
java.lang.Object
net.i2p.util.LogWriterBase
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- LogWriter
abstract class LogWriterBase
- extends Object
- implements Runnable
Log writer thread that pulls log records from the LogManager and writes them to
the log. This also periodically instructs the LogManager to reread its config
file.
- Since:
- 0.9.19 pulled from LogWriter so Android may extend
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FLUSH_INTERVAL
static final long FLUSH_INTERVAL
- See Also:
- Constant Field Values
_manager
protected final LogManager _manager
_write
protected volatile boolean _write
LogWriterBase
public LogWriterBase(LogManager manager)
currentFile
public abstract String currentFile()
writeRecord
protected abstract void writeRecord(LogRecord rec,
String formatted)
- Write the provided LogRecord to the writer.
- Parameters:
rec
- the LogRecord to write.formatted
- a String pre-formatted from rec, may be ignored.
writeRecord
protected abstract void writeRecord(int priority,
String line)
- Write a single String verbatim to the writer.
- Parameters:
priority
- the level to log the line at.line
- the String to write.
flushWriter
protected abstract void flushWriter()
closeWriter
protected abstract void closeWriter()
stopWriting
public void stopWriting()
setFlushInterval
public void setFlushInterval(long interval)
- Parameters:
interval
- ms- Since:
- 0.9.18
run
public void run()
- Specified by:
run
in interface Runnable
flushRecords
public void flushRecords()
flushRecords
public void flushRecords(boolean shouldWait)