net.i2p.util
Class LogWriter

java.lang.Object
  extended by net.i2p.util.LogWriterBase
      extended by net.i2p.util.LogWriter
All Implemented Interfaces:
Runnable

 class LogWriter
extends LogWriterBase

File-based log writer thread that pulls log records from the LogManager, writes them to the current logfile, and rotates the logs as necessary.


Field Summary
 
Fields inherited from class net.i2p.util.LogWriterBase
_manager, _write, FLUSH_INTERVAL
 
Constructor Summary
LogWriter(LogManager manager)
           
 
Method Summary
protected  void closeWriter()
           
 String currentFile()
          File may not exist or have old logs in it if not opened yet
protected  void flushWriter()
           
protected  void writeRecord(int priority, String val)
          Write a single String verbatim to the writer.
protected  void writeRecord(LogRecord rec, String formatted)
          Write the provided LogRecord to the writer.
 
Methods inherited from class net.i2p.util.LogWriterBase
flushRecords, flushRecords, run, setFlushInterval, stopWriting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogWriter

public LogWriter(LogManager manager)
Method Detail

currentFile

public String currentFile()
File may not exist or have old logs in it if not opened yet

Specified by:
currentFile in class LogWriterBase

writeRecord

protected void writeRecord(LogRecord rec,
                           String formatted)
Description copied from class: LogWriterBase
Write the provided LogRecord to the writer.

Specified by:
writeRecord in class LogWriterBase
Parameters:
rec - the LogRecord to write.
formatted - a String pre-formatted from rec, may be ignored.

writeRecord

protected void writeRecord(int priority,
                           String val)
Description copied from class: LogWriterBase
Write a single String verbatim to the writer.

Specified by:
writeRecord in class LogWriterBase
Parameters:
priority - the level to log the line at.
val - the String to write.

flushWriter

protected void flushWriter()
Specified by:
flushWriter in class LogWriterBase
Since:
0.9.19

closeWriter

protected void closeWriter()
Specified by:
closeWriter in class LogWriterBase
Since:
0.9.19 renamed from closeFile()