|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectWriter
PrintWriter
LogPrintWriter
public class LogPrintWriter
This class implements a custom PrintWriter that extracts the class name, method name and line number of the caller from the stack trace.
| Constructor Summary | |
|---|---|
LogPrintWriter(OutputStream out)
Constructor. |
|
LogPrintWriter(OutputStream out,
boolean autoFlush)
Constructor. |
|
LogPrintWriter(Writer out)
Constructor. |
|
LogPrintWriter(Writer out,
boolean autoFlush)
Constructor. |
|
| Method Summary | |
|---|---|
String |
getClassName()
Returns contents of the className field. |
int |
getLineNumber()
Returns contents of the lineNumber field. |
String |
getMethodName()
Returns contents of the methodName field. |
void |
print(String s)
Overwrites the default implementation and sends the data to the decode method. |
void |
println(char[] s)
Overwrites the default implementation and sends the data to the decode method. |
void |
println(String s)
Overwrites the default implementation and sends the data to the decode method. |
void |
setCallerStackElement(short callerStackElement)
Sets the index of the caller stack element. |
| Methods inherited from class PrintWriter |
|---|
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, write, write, write, write, write |
| Methods inherited from class Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LogPrintWriter(Writer out)
public LogPrintWriter(OutputStream out)
public LogPrintWriter(Writer out,
boolean autoFlush)
public LogPrintWriter(OutputStream out,
boolean autoFlush)
| Method Detail |
|---|
public void println(String s)
println in class PrintWriterpublic void println(char[] s)
println in class PrintWriterpublic void print(String s)
print in class PrintWriterpublic String getClassName()
public int getLineNumber()
public String getMethodName()
public void setCallerStackElement(short callerStackElement)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||