Package org.smooks.testkit
Class StdoutToLog4jFilter
- java.lang.Object
- 
- java.io.Writer
- 
- java.io.FilterWriter
- 
- org.smooks.testkit.StdoutToLog4jFilter
 
 
 
- 
- All Implemented Interfaces:
- Closeable,- Flushable,- Appendable,- AutoCloseable
 
 public class StdoutToLog4jFilter extends FilterWriter StoutToLog4jFilter is just a simple FileWriter implementation that supresses output unless the log4j priority is set to debug. This class in indended to be used with hsql embedded server and to be used like this:Log targetLogger = LogFactory.getLog("org.hsqldb"); server.setLogWriter(new PrintWriter(new StdoutToLog4jFilter(server.getLogWriter(), targetLogger)));- Author:
- Daniel Bevenius
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected org.slf4j.LoggerloggerLog to log check logging level.protected StringBuildersbstring "buffer"- 
Fields inherited from class java.io.FilterWriterout
 
- 
 - 
Constructor SummaryConstructors Constructor Description StdoutToLog4jFilter(Writer writer)StdoutToLog4jFilter(Writer writer, org.slf4j.Logger logger)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidfinalize()voidflush()protected voidlog()protected voidstripExtraNewLine()voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(String str, int off, int len)
 
- 
- 
- 
Field Detail- 
loggerprotected org.slf4j.Logger logger Log to log check logging level.
 - 
sbprotected final StringBuilder sb string "buffer"
 
- 
 - 
Method Detail- 
writepublic void write(int c) throws IOException- Overrides:
- writein class- FilterWriter
- Throws:
- IOException
 
 - 
writepublic void write(char[] cbuf, int off, int len) throws IOException- Overrides:
- writein class- FilterWriter
- Throws:
- IOException
 
 - 
writepublic void write(String str, int off, int len) throws IOException - Overrides:
- writein class- FilterWriter
- Throws:
- IOException
 
 - 
flushpublic void flush() throws IOException- Specified by:
- flushin interface- Flushable
- Overrides:
- flushin class- FilterWriter
- Throws:
- IOException
 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- FilterWriter
- Throws:
- IOException
 
 - 
finalizeprotected void finalize() throws Throwable
 - 
logprotected void log() 
 - 
stripExtraNewLineprotected final void stripExtraNewLine() 
 
- 
 
-