iaik.tc.utils.logging.java12
Class LogPrintWriter

Object
  extended by Writer
      extended by PrintWriter
          extended by LogPrintWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class LogPrintWriter
extends PrintWriter

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

LogPrintWriter

public LogPrintWriter(Writer out)
Constructor.


LogPrintWriter

public LogPrintWriter(OutputStream out)
Constructor.


LogPrintWriter

public LogPrintWriter(Writer out,
                      boolean autoFlush)
Constructor.


LogPrintWriter

public LogPrintWriter(OutputStream out,
                      boolean autoFlush)
Constructor.

Method Detail

println

public void println(String s)
Overwrites the default implementation and sends the data to the decode method.

Overrides:
println in class PrintWriter

println

public void println(char[] s)
Overwrites the default implementation and sends the data to the decode method.

Overrides:
println in class PrintWriter

print

public void print(String s)
Overwrites the default implementation and sends the data to the decode method.

Overrides:
print in class PrintWriter

getClassName

public String getClassName()
Returns contents of the className field.


getLineNumber

public int getLineNumber()
Returns contents of the lineNumber field.


getMethodName

public String getMethodName()
Returns contents of the methodName field.


setCallerStackElement

public void setCallerStackElement(short callerStackElement)
Sets the index of the caller stack element.