Package net.i2p.util
Class LogWriter
java.lang.Object
net.i2p.util.LogWriter
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
FileLogWriter
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 FileLogWriter so Android may extend; renamed from LogWriterBase in 0.9.26
-
Field Summary
Modifier and TypeFieldDescriptionprotected final LogManager
protected boolean
(package private) static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
abstract String
File may not exist or have old logs in it if not opened yetvoid
void
flushRecords
(boolean shouldWait) protected abstract void
void
run()
void
setFlushInterval
(long interval) void
protected abstract void
writeRecord
(int priority, String line) Write a single String verbatim to the writer.protected abstract void
writeRecord
(LogRecord rec, String formatted) Write the provided LogRecord to the writer.
-
Field Details
-
FLUSH_INTERVAL
static final long FLUSH_INTERVAL- See Also:
-
_manager
-
_write
protected volatile boolean _write
-
-
Constructor Details
-
LogWriter
-
-
Method Details
-
currentFile
File may not exist or have old logs in it if not opened yet- Returns:
- non-null
-
writeRecord
Write the provided LogRecord to the writer.- Parameters:
rec
- the LogRecord to write.formatted
- a String pre-formatted from rec, may be ignored.
-
writeRecord
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() -
flushRecords
public void flushRecords() -
flushRecords
public void flushRecords(boolean shouldWait)
-