frysk.rsl
Class Printer

java.lang.Object
  extended by frysk.rsl.Printer

public final class Printer
extends Object

Class for accumulating and then displaying log messages.


Field Summary
private  PrintWriter out
           
private static long startTime
           
 
Constructor Summary
Printer(PrintWriter out)
          Start with this single printer, will eventually need to make things more complex with sub-classes.
 
Method Summary
private  void dump(boolean b)
           
private  void dump(boolean[] a)
           
private  void dump(char c)
           
private  void dump(char[] a)
           
private  void dump(int i)
           
private  void dump(int[] a)
           
private  void dump(long l)
           
private  void dump(long[] a)
           
private  void dump(Object o)
           
private  void dump(Object o, int i)
          Dump the array object's i'th element
private  void dump(String s)
           
private  void dump(Throwable t)
          Throwables get their message printed; along with any root causes.
 Printer prefix(Log logger)
           
 Printer prefix(Log logger, Object o)
           
private  void prefixTimeAndPid(Level level)
           
 Printer print(boolean b)
          Booleans are printed as strings.
 Printer print(char c)
          Chars are printed in quotes.
 Printer print(int i)
          Integers are printed in decimal.
 Printer print(long l)
          Longs are printed in hex.
 Printer print(Object o)
          Use poorly implemented reflection to dump Objects.
 Printer print(String s)
          Strings are just copied.
 void suffix()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private final PrintWriter out

startTime

private static final long startTime
Constructor Detail

Printer

Printer(PrintWriter out)
Start with this single printer, will eventually need to make things more complex with sub-classes.

Method Detail

prefixTimeAndPid

private void prefixTimeAndPid(Level level)

prefix

public Printer prefix(Log logger)

prefix

public Printer prefix(Log logger,
                      Object o)

suffix

public void suffix()

print

public Printer print(Object o)
Use poorly implemented reflection to dump Objects.


dump

private void dump(Object o)

dump

private void dump(Throwable t)
Throwables get their message printed; along with any root causes.


dump

private void dump(String s)

dump

private void dump(Object o,
                  int i)
Dump the array object's i'th element

Parameters:
o - the array object
i - the array index

print

public Printer print(boolean b)
Booleans are printed as strings.


dump

private void dump(boolean b)

dump

private void dump(boolean[] a)

print

public Printer print(char c)
Chars are printed in quotes.


dump

private void dump(char c)

dump

private void dump(char[] a)

print

public Printer print(int i)
Integers are printed in decimal.


dump

private void dump(int i)

dump

private void dump(int[] a)

print

public Printer print(long l)
Longs are printed in hex.


dump

private void dump(long l)

dump

private void dump(long[] a)

print

public Printer print(String s)
Strings are just copied.