dfischer.femtowebserver.lib
Class Stdout

java.lang.Object
  |
  +--dfischer.femtowebserver.lib.Stdout

public class Stdout
extends java.lang.Object

Thread save library for log output to a print stream. Each output line contains additionally as prefix the name of the current thread (caller) and the current date and time. The log output will be displayed on System.out if no other print stream has been set with the method setLogStream().

See Also:
Httpd.setLogStream(java.io.PrintStream), setLogStream(java.io.PrintStream), ZoneTime

Method Summary
static java.io.PrintStream getLogStream()
          Returns the current print stream for the log output
static void log()
          Writes an empty line to the log output.
static void log(byte[] binaryData)
          Writes binary data as ASCII/TEXT to the log output.
static void log(java.lang.String msg)
          Writes a text line to the log output.
static void log(java.lang.StringBuffer msg)
          Writes a string buffer to the log output.
static void log(java.lang.String preComment, java.lang.Exception e)
          Writes a stack trace of an exception to the log output.
static void log(java.util.Vector msgVector)
          Writes a Vector of Type java.lang.String to the log output.
static void setLogStream(java.io.PrintStream logStream)
          Sets the log output to an other print stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setLogStream

public static void setLogStream(java.io.PrintStream logStream)
Sets the log output to an other print stream. The default pre-configured print stream is System.out .
Parameters:
logStream - print stream for the log output or null, to disable the log output.

getLogStream

public static java.io.PrintStream getLogStream()
Returns the current print stream for the log output
Returns:
current print stream for the log output or null, if the log output is disabled

log

public static void log()
Writes an empty line to the log output. However, the prefixes "tread-name" and "date/time" will always be written.

log

public static void log(java.lang.String msg)
Writes a text line to the log output.
Parameters:
msg - text line to write

log

public static void log(java.lang.StringBuffer msg)
Writes a string buffer to the log output.
Parameters:
msg - string buffer to write

log

public static void log(java.util.Vector msgVector)
Writes a Vector of Type java.lang.String to the log output. Each element of the Vector will be written as a separate line.
Parameters:
msgVector - Vector of Type java.lang.String to write

log

public static void log(java.lang.String preComment,
                       java.lang.Exception e)
Writes a stack trace of an exception to the log output.
Parameters:
preComment - inserts a text string at the start of every line of the stack trace. You may pass null or an empty string to disable this behavior.
e - exception whose stack trace will be written

log

public static void log(byte[] binaryData)
Writes binary data as ASCII/TEXT to the log output. Conversions:
Parameters:
binaryData - binary data to write as ASCII/TEXT dump