net.mtu.eggplant.io
Class LogWriter
java.lang.Object
java.io.Writer
net.mtu.eggplant.io.LogWriter
- All Implemented Interfaces:
- Closeable, Flushable, Appendable
public class LogWriter
- extends Writer
Writer that outputs to the current logging facility (SLF4J).
Method Summary |
void |
close()
|
void |
flush()
|
void |
write(char[] cbuf,
int off,
int len)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LogWriter
public LogWriter(Logger logger,
LogWriter.LogLevel level)
- Parameters:
logger
- the logger to log tolevel
- the level to log at
- Throws:
NullPointerException
- if logger or level is null
LogWriter
public LogWriter(Object lock,
Logger logger,
LogWriter.LogLevel level)
- Parameters:
lock
- the locklogger
- the logger to log tolevel
- the level to log at
- Throws:
NullPointerException
- if logger or level is null
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Specified by:
close
in class Writer
- Throws:
IOException
- See Also:
Writer.close()
flush
public void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Specified by:
flush
in class Writer
- Throws:
IOException
- See Also:
Writer.flush()
write
public void write(char[] cbuf,
int off,
int len)
throws IOException
- Specified by:
write
in class Writer
- Throws:
IOException
- See Also:
Writer.write(char[], int, int)