dip.misc
Class Log

java.lang.Object
  extended bydip.misc.Log

public final class Log
extends java.lang.Object

A very simple logging class that logs all data to stdout. Note that this was implemented for speed and simplicity, rather than using the J2SDK intrinsic Logging class.

By matching methods to log callers, we eliminate String or StringBuffer construction and Object.toString() invocations, which provides a significant speedup.

This class is not really MT safe


Method Summary
static void close()
          Flushes and closes the log file (if writing to stdout, this has no effect)
static boolean isLogging()
          Check if logging is enabled or disabled
static void print(java.lang.Object s)
          Print the given Object to the output file / stdout via the Object's toString() method.
static void println(java.lang.Object s)
          Print the given Object to the output file / stdout via the Object's toString() method.
static void println(java.lang.Object s0, int i0)
          Print text followed by an int
static void println(java.lang.Object s0, java.lang.Object s1)
          Print the given objects to the log
static void println(java.lang.Object s0, java.lang.Object s1, java.lang.Object s2)
          Print the given objects to the log
static void println(java.lang.Object s0, java.lang.Object s1, java.lang.Object s2, java.lang.Object s3)
          Print the given objects to the log
static void printTimed(long lastTime, java.lang.Object s0)
          Print text followed timing delta and current time.
static void setFile(java.io.File out)
          Set the File to which we will write (or append) a Log file, if null, write output to stdout.
static void setLogging(boolean value)
          Enable or disable logging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setLogging

public static void setLogging(boolean value)
Enable or disable logging


isLogging

public static boolean isLogging()
Check if logging is enabled or disabled


setFile

public static void setFile(java.io.File out)
Set the File to which we will write (or append) a Log file, if null, write output to stdout.


close

public static void close()
Flushes and closes the log file (if writing to stdout, this has no effect)


print

public static void print(java.lang.Object s)
Print the given Object to the output file / stdout via the Object's toString() method.


println

public static void println(java.lang.Object s)
Print the given Object to the output file / stdout via the Object's toString() method. Follows with a newline.


println

public static void println(java.lang.Object s0,
                           int i0)
Print text followed by an int


printTimed

public static void printTimed(long lastTime,
                              java.lang.Object s0)
Print text followed timing delta and current time.


println

public static void println(java.lang.Object s0,
                           java.lang.Object s1)
Print the given objects to the log


println

public static void println(java.lang.Object s0,
                           java.lang.Object s1,
                           java.lang.Object s2)
Print the given objects to the log


println

public static void println(java.lang.Object s0,
                           java.lang.Object s1,
                           java.lang.Object s2,
                           java.lang.Object s3)
Print the given objects to the log



Copyright 2002-2004 Zachary DelProposto / jDip Development Team. All Rights Reserved.