com.townleyenterprises.trace
Class SystemTraceStream

java.lang.Object
  extended bycom.townleyenterprises.trace.SystemTraceStream
All Implemented Interfaces:
TraceStream

public class SystemTraceStream
extends java.lang.Object
implements TraceStream

This class provides a TraceStream implementation which is based on System.err and is the default trace stream used unless otherwise configured.

Since:
3.0
Version:
$Id: SystemTraceStream.java,v 1.1 2004/11/27 17:32:50 atownley Exp $
Author:
Andrew S. Townley

Method Summary
 void close()
          This method closes the trace stream.
static TraceStream getInstance()
          This is the singleton's factory method for creating or obtaining a reference.
 java.io.PrintStream getPrintStream()
          This method returns the print stream associated with this output.
 void print(java.lang.Object message)
          This method writes the message to the trace output, but doesn't include the newline.
 void println(java.lang.Object message)
          This method writes a line to the trace output.
 void printStackTrace(java.lang.Throwable ex)
          This method is used to write an exception's stack trace to the trace output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TraceStream getInstance()
This is the singleton's factory method for creating or obtaining a reference.

Returns:
a TraceStream

print

public void print(java.lang.Object message)
This method writes the message to the trace output, but doesn't include the newline.

Specified by:
print in interface TraceStream
Parameters:
message - the message to write

println

public void println(java.lang.Object message)
This method writes a line to the trace output.

Specified by:
println in interface TraceStream
Parameters:
message - the message to write

printStackTrace

public void printStackTrace(java.lang.Throwable ex)
This method is used to write an exception's stack trace to the trace output.

Specified by:
printStackTrace in interface TraceStream
Parameters:
ex - the exception to print

getPrintStream

public java.io.PrintStream getPrintStream()
This method returns the print stream associated with this output.

Specified by:
getPrintStream in interface TraceStream
Returns:
a PrintStream instance

close

public void close()
This method closes the trace stream.

Specified by:
close in interface TraceStream


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.