|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
org.objectweb.util.monolog.wrapper.printwriter.PrintStreamImpl
public class PrintStreamImpl
This class is a PrintStream wrapper. It exports the Printstream 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.
Field Summary | |
---|---|
protected java.lang.String |
currentLine
This field is the buffer which represents the current line. |
protected int |
level
|
protected Logger |
logger
|
protected LoggerFactory |
loggerFactory
|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
PrintStreamImpl(Logger l)
It builds a PrintWriterImpl instance. |
|
PrintStreamImpl(Logger l,
int level)
It builds a PrintWriterImpl instance. |
Method Summary | |
---|---|
boolean |
checkError()
Always retrieves 'false' |
protected java.lang.Object |
clone()
Always throws a CloneNotSupportedException |
void |
close()
Do nothing |
boolean |
equals(java.lang.Object o)
Compare the inner loggers |
void |
flush()
Do nothing |
int |
getLevel()
Retrieves the level of the messages |
Logger |
getLogger()
Retrieves the logger instance used |
LoggerFactory |
getLoggerFactory()
Retrieves the logger factory instance used |
void |
print(boolean b)
Writes the boolean value in the buffer |
void |
print(char c)
Writes the char value in the buffer |
void |
print(char[] chars)
Writes the char[] value as a String in the buffer |
void |
print(double v)
Writes the double value in the buffer |
void |
print(float v)
Writes the float value in the buffer |
void |
print(int i)
Writes the int value in the buffer |
void |
print(long l)
Writes the long value in the buffer |
void |
print(java.lang.Object o)
Writes the Object value as a String in the buffer |
void |
print(java.lang.String s)
Writes the String value in the buffer |
void |
println()
log the buffer |
void |
println(boolean b)
1/ Write a boolean value in the buffer. |
void |
println(char c)
1/ Write a char value in the buffer 2/ Log the buffer 3/ Clear the buffer |
void |
println(char[] chars)
1/ Write a char[] value in the buffer 2/ Log the buffer 3/ Clear the buffer |
void |
println(double v)
1/ Write a double value in the buffer 2/ Log the buffer 3/ Clear the buffer |
void |
println(float v)
1/ Write a float value in the buffer 2/ Log the buffer 3/ Clear the buffer |
void |
println(int i)
1/ Write an int value in the buffer 2/ Log the buffer 3/ Clear the buffer |
void |
println(long l)
1/ Write a long value in the buffer 2/ Log the buffer 3/ Clear the buffer |
void |
println(java.lang.Object o)
1/ Write a object value in the buffer 2/ Log the buffer 3/ Clear the buffer |
void |
println(java.lang.String s)
1/ Write a String value in the buffer 2/ Log the buffer 3/ Clear the buffer |
protected void |
setError()
Do nothing |
void |
setLevel(int level)
Changes the level of the messages |
void |
setLogger(Logger logger)
Assigns the logger instance to use |
void |
setLoggerFactory(LoggerFactory lf)
Assigns the logger factory instance to use |
java.lang.String |
toString()
Call the toString() method over the inner logger |
void |
write(byte[] bytes)
Writes the byte[] as a string in the buffer |
void |
write(byte[] bytes,
int i,
int i1)
Writes the byte[] as a string in the buffer |
void |
write(int i)
Writes the int value in the buffer |
Methods inherited from class java.io.PrintStream |
---|
append, append, append, clearError, format, format, printf, printf |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Logger logger
protected LoggerFactory loggerFactory
protected java.lang.String currentLine
protected int level
Constructor Detail |
---|
public PrintStreamImpl(Logger l) throws java.lang.NullPointerException
l
- is the logger toward which the message must be send
java.lang.NullPointerException
- if the parameter is null.public PrintStreamImpl(Logger l, int level) throws java.lang.NullPointerException
l
- is the logger toward which the message must be sendlevel
- is the level used to log message.
java.lang.NullPointerException
- if the parameter is null.Method Detail |
---|
public int getLevel()
public void setLevel(int level)
level
- is the new levelpublic Logger getLogger()
getLogger
in interface Loggable
public void setLogger(Logger logger)
setLogger
in interface Loggable
public LoggerFactory getLoggerFactory()
getLoggerFactory
in interface Loggable
public void setLoggerFactory(LoggerFactory lf)
setLoggerFactory
in interface Loggable
public void write(byte[] bytes)
write
in class java.io.FilterOutputStream
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.PrintStream
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void close()
close
in interface java.io.Closeable
close
in class java.io.PrintStream
public java.lang.String toString()
toString
in class java.lang.Object
public boolean checkError()
checkError
in class java.io.PrintStream
protected void setError()
setError
in class java.io.PrintStream
public void write(int i)
write
in class java.io.PrintStream
public void write(byte[] bytes, int i, int i1)
write
in class java.io.PrintStream
public void print(boolean b)
print
in class java.io.PrintStream
public void print(char c)
print
in class java.io.PrintStream
public void print(int i)
print
in class java.io.PrintStream
public void print(long l)
print
in class java.io.PrintStream
public void print(float v)
print
in class java.io.PrintStream
public void print(double v)
print
in class java.io.PrintStream
public void print(char[] chars)
print
in class java.io.PrintStream
public void print(java.lang.String s)
print
in class java.io.PrintStream
public void print(java.lang.Object o)
print
in class java.io.PrintStream
public void println()
println
in class java.io.PrintStream
public void println(boolean b)
println
in class java.io.PrintStream
public void println(char c)
println
in class java.io.PrintStream
public void println(int i)
println
in class java.io.PrintStream
public void println(long l)
println
in class java.io.PrintStream
public void println(float v)
println
in class java.io.PrintStream
public void println(double v)
println
in class java.io.PrintStream
public void println(char[] chars)
println
in class java.io.PrintStream
public void println(java.lang.String s)
println
in class java.io.PrintStream
public void println(java.lang.Object o)
println
in class java.io.PrintStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |