abstract class LogWriter extends Object implements Runnable
Modifier and Type | Field and Description |
---|---|
protected LogManager |
_manager |
protected boolean |
_write |
(package private) static long |
FLUSH_INTERVAL |
Constructor and Description |
---|
LogWriter(LogManager manager) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
closeWriter() |
abstract String |
currentFile()
File may not exist or have old logs in it if not opened yet
|
void |
flushRecords() |
void |
flushRecords(boolean shouldWait) |
protected abstract void |
flushWriter() |
void |
run() |
void |
setFlushInterval(long interval) |
void |
stopWriting() |
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.
|
static final long FLUSH_INTERVAL
protected final LogManager _manager
protected volatile boolean _write
public LogWriter(LogManager manager)
public abstract String currentFile()
protected abstract void writeRecord(LogRecord rec, String formatted)
rec
- the LogRecord to write.formatted
- a String pre-formatted from rec, may be ignored.protected abstract void writeRecord(int priority, String line)
priority
- the level to log the line at.line
- the String to write.protected abstract void flushWriter()
protected abstract void closeWriter()
public void stopWriting()
public void setFlushInterval(long interval)
interval
- mspublic void flushRecords()
public void flushRecords(boolean shouldWait)