| java.io.PrintWriter org.objectweb.util.monolog.wrapper.printwriter.PrintWriterImpl
PrintWriterImpl | public class PrintWriterImpl extends PrintWriter implements Loggable(Code) | | This class is a PrintWriter wrapper. It exports the PrintWriter methods but
fowards the message to a Logger. This implementation bufferizes the data when
a print method is used. The buffer and the data are always written when a
println method is used. No end of line are inserted by the println methods.
A line is equals to a monolog message.
author: Sebastien Chassande-Barrioz |
Constructor Summary | |
public | PrintWriterImpl(Logger l) It builds a PrintWriterImpl instance. | public | PrintWriterImpl(Logger logger, LoggerFactory loggerFactory) It builds a PrintWriterImpl instance. | public | PrintWriterImpl(Logger l, int level) It builds a PrintWriterImpl instance.
Parameters: l - is the logger toward which the message must be send Parameters: level - is the level used to log message. |
Method Summary | |
public boolean | checkError() Flush the stream and check its error state. | public void | close() | public void | flush() | public int | getLevel() | public Logger | getLogger() | public LoggerFactory | getLoggerFactory() | public void | print(boolean x) Print a boolean value in the buffer. | public void | print(char x) Print a character in the buffer. | public void | print(char[] x) Print an array of characters in the buffer. | public void | print(double x) Print a double-precision floating-point number in the buffer. | public void | print(float x) Print a floating-point number in the buffer. | public void | print(int x) Print an integer in the buffer. | public void | print(long x) Print a long integer in the buffer. | public void | print(Object x) Print an object in the buffer. | public void | print(String x) Print a string in the buffer. | public void | println() | public void | println(boolean x) | public void | println(char x) | public void | println(char[] x) | public void | println(double x) Send the buffer and a a double-precision floating-point number to the
logger. | public void | println(float x) | public void | println(int x) | public void | println(long x) | public void | println(Object x) | public void | println(String x) | protected void | setError() Indicate that an error has occurred. | public void | setLevel(int level) | public void | setLogger(Logger logger) | public void | setLoggerFactory(LoggerFactory lf) | public void | write(char[] buf) Write an array of characters in the buffer. | public void | write(char[] buf, int off, int len) Write a portion of an array of characters in the buffer. | public void | write(int c) Write a single character in the buffer. | public void | write(String s) Write a string in the buffer. | public void | write(String s, int off, int len) Write a portion of a string in the buffer. |
currentLine | protected String currentLine(Code) | | This field is the buffer which represents the current line.
|
errors | protected boolean errors(Code) | | This field indicates the setError method was called.
|
level | protected int level(Code) | | |
logger | protected Logger logger(Code) | | The inner logger instance
|
PrintWriterImpl | public PrintWriterImpl(Logger l) throws NullPointerException(Code) | | It builds a PrintWriterImpl instance. The default level is DEBUG
Parameters: l - is the logger toward which the message must be send throws: NullPointerException - if the parameter is null. |
PrintWriterImpl | public PrintWriterImpl(Logger logger, LoggerFactory loggerFactory) throws NullPointerException(Code) | | It builds a PrintWriterImpl instance. The default level is DEBUG
Parameters: logger - is the logger toward which the message must be send Parameters: loggerFactory - is the loggerFactory of the logger throws: NullPointerException - if one of the parameters is null. |
PrintWriterImpl | public PrintWriterImpl(Logger l, int level) throws NullPointerException(Code) | | It builds a PrintWriterImpl instance.
Parameters: l - is the logger toward which the message must be send Parameters: level - is the level used to log message. throws: NullPointerException - if the parameter is null. |
checkError | public boolean checkError()(Code) | | Flush the stream and check its error state.
|
close | public void close()(Code) | | It writes the buffer if it is not empty
|
flush | public void flush()(Code) | | It writes the buffer if it is not empty
|
getLevel | public int getLevel()(Code) | | |
getLogger | public Logger getLogger()(Code) | | Retrieves the logger instance used
|
getLoggerFactory | public LoggerFactory getLoggerFactory()(Code) | | Retrieves the logger factory instance used
|
print | public void print(boolean x)(Code) | | Print a boolean value in the buffer.
|
print | public void print(char x)(Code) | | Print a character in the buffer.
|
print | public void print(char[] x)(Code) | | Print an array of characters in the buffer.
|
print | public void print(double x)(Code) | | Print a double-precision floating-point number in the buffer.
|
print | public void print(float x)(Code) | | Print a floating-point number in the buffer.
|
print | public void print(int x)(Code) | | Print an integer in the buffer.
|
print | public void print(long x)(Code) | | Print a long integer in the buffer.
|
print | public void print(Object x)(Code) | | Print an object in the buffer.
|
print | public void print(String x)(Code) | | Print a string in the buffer.
|
println | public void println()(Code) | | Send the buffer to the logger
|
println | public void println(boolean x)(Code) | | Send the buffer and a boolean value to the logger
|
println | public void println(char x)(Code) | | Send the buffer and a character to the logger
|
println | public void println(char[] x)(Code) | | Send the buffer and an array of characters to the logger
|
println | public void println(double x)(Code) | | Send the buffer and a a double-precision floating-point number to the
logger.
|
println | public void println(float x)(Code) | | Send the buffer and a floating-point number to the logger
|
println | public void println(int x)(Code) | | Send the buffer and an integer to the logger
|
println | public void println(long x)(Code) | | Send the buffer and a long integer number to the logger
|
println | public void println(Object x)(Code) | | Send the buffer and an object to the logger
|
println | public void println(String x)(Code) | | Send the buffer and a String to the logger
|
setError | protected void setError()(Code) | | Indicate that an error has occurred.
|
setLevel | public void setLevel(int level)(Code) | | |
setLogger | public void setLogger(Logger logger)(Code) | | Assigns the logger instance to use
|
setLoggerFactory | public void setLoggerFactory(LoggerFactory lf)(Code) | | Assigns the logger factory instance to use
|
write | public void write(char[] buf)(Code) | | Write an array of characters in the buffer.
|
write | public void write(char[] buf, int off, int len)(Code) | | Write a portion of an array of characters in the buffer.
|
write | public void write(int c)(Code) | | Write a single character in the buffer.
|
write | public void write(String s)(Code) | | Write a string in the buffer.
|
write | public void write(String s, int off, int len)(Code) | | Write a portion of a string in the buffer.
|
Methods inherited from java.io.PrintWriter | public PrintWriter append(CharSequence csq)(Code)(Java Doc) public PrintWriter append(CharSequence csq, int start, int end)(Code)(Java Doc) public PrintWriter append(char c)(Code)(Java Doc) public boolean checkError()(Code)(Java Doc) protected void clearError()(Code)(Java Doc) public void close()(Code)(Java Doc) public void flush()(Code)(Java Doc) public PrintWriter format(String format, Object... args)(Code)(Java Doc) public PrintWriter format(Locale l, String format, Object... args)(Code)(Java Doc) public void print(boolean b)(Code)(Java Doc) public void print(char c)(Code)(Java Doc) public void print(int i)(Code)(Java Doc) public void print(long l)(Code)(Java Doc) public void print(float f)(Code)(Java Doc) public void print(double d)(Code)(Java Doc) public void print(char s)(Code)(Java Doc) public void print(String s)(Code)(Java Doc) public void print(Object obj)(Code)(Java Doc) public PrintWriter printf(String format, Object... args)(Code)(Java Doc) public PrintWriter printf(Locale l, String format, Object... args)(Code)(Java Doc) public void println()(Code)(Java Doc) public void println(boolean x)(Code)(Java Doc) public void println(char x)(Code)(Java Doc) public void println(int x)(Code)(Java Doc) public void println(long x)(Code)(Java Doc) public void println(float x)(Code)(Java Doc) public void println(double x)(Code)(Java Doc) public void println(char x)(Code)(Java Doc) public void println(String x)(Code)(Java Doc) public void println(Object x)(Code)(Java Doc) protected void setError()(Code)(Java Doc) public void write(int c)(Code)(Java Doc) public void write(char buf, int off, int len)(Code)(Java Doc) public void write(char buf)(Code)(Java Doc) public void write(String s, int off, int len)(Code)(Java Doc) public void write(String s)(Code)(Java Doc)
|
|
|