sam.io
Class PrintTrace

java.lang.Object
  |
  +--sam.io.PrintTrace

public class PrintTrace
extends java.lang.Object

Standard output trace. This is a simple encapsulation of a named PrintWriter whose initialization is lazy.


Field Summary
 java.lang.String name
          Name of this trace, e.g.
 java.lang.String type
          Type of this trace
 
Method Summary
static java.lang.String example(java.lang.String example)
          Draws an example from given file name and standard streams.
static sam.io.PrintTrace make(java.lang.String trace, java.lang.String type)
          Creates an adequate printable trace.
 java.io.PrintWriter out()
          Gets the output writer of this trace.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public final java.lang.String name
Name of this trace, e.g. the underlying file name


type

public final java.lang.String type
Type of this trace

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

make

public static sam.io.PrintTrace make(java.lang.String trace,
                                     java.lang.String type)
Creates an adequate printable trace.

Parameters:
trace - either "stdout", "stderr" or any valid writable file name
type - a single-word description of the trace type, e.g. "log" or "skipped_entries" Additionnally blank specification is an alias for Settings.Default.TRACE(type)
Returns:
a lazy initialization PrintTrace or null if error

example

public static java.lang.String example(java.lang.String example)
Draws an example from given file name and standard streams.


out

public java.io.PrintWriter out()
Gets the output writer of this trace. Note that its initialization is delayed to the first call of this method, which avoids creating log files that will never be used.