Simple logging facility. This logger extends
PrintWriter
which is used to trace SQL statements, Castor operations and
mapping resolutions.
This logger augments
PrintWriter by adding a prefix to
each printed line and optionally a time stamp, enabling easy
post-mortem analysis.
getSystemLogger
public static PrintWriter getSystemLogger()
Returns the default logger. This logger is used to produce
system messages.
prefixLine
protected final void prefixLine()
Called before printing from all of the print methods.
If at the beginning of a new line, the data/time and
prefix will be printed.
print
public void print(Object value)
print
public void print(String value)
print
public void print(boolean value)
print
public void print(char value)
print
public void print(char[] value)
print
public void print(double value)
print
public void print(float value)
print
public void print(int value)
print
public void print(long value)
println
public void println()
println
public void println(Object value)
println
public void println(String value)
println
public void println(boolean value)
println
public void println(char value)
println
public void println(char[] value)
println
public void println(double value)
println
public void println(float value)
println
public void println(int value)
println
public void println(long value)
setLogTime
public Logger setLogTime(boolean logTime)
Determines whether to print the time at the beggining of
each log line.
logTime
- True if time should appear at the beggining
of each log line
setPrefix
public Logger setPrefix(String prefix)
Sets the prefix, a short name to print at the beginning
of each log line. If a null is passed, no prefix precedes
logged lines.
prefix
- The prefix to use for each line
setSystemLogger
public static void setSystemLogger(PrintWriter system)
Sets the default logger. This logger is used to produce
system messages.