edu.wpi.prc.persistence
Class SpotCheckLogger

java.lang.Object
  extended by edu.wpi.prc.persistence.SpotCheckLogger

public class SpotCheckLogger
extends java.lang.Object

Logs failed spot checks to the spot check log file.

Author:
James Baldassari

Field Summary
static java.lang.String DEFAULT_LOG_DIR
           
static java.lang.String DEFAULT_LOG_PATH
           
private static java.lang.String LOG_TIMESTAMP_FORMAT
           
private  java.io.File logFile
           
private  java.io.FileOutputStream logFileStream
           
private static SpotCheckLogger logger
           
private  java.io.PrintStream logStream
           
private static java.text.SimpleDateFormat timestampFormat
           
 
Constructor Summary
private SpotCheckLogger()
          Private constructor.
 
Method Summary
static void initialize()
          Opens the default log file for appending and initializes the streams.
static void initialize(java.lang.String logPath)
          Opens the log file for appending and initializes the streams.
static void print(java.lang.String str)
          Writes the given string to the log file.
static void println(java.lang.String str)
          Writes the given string to the log file, then writes a new line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static SpotCheckLogger logger

DEFAULT_LOG_DIR

public static final java.lang.String DEFAULT_LOG_DIR
See Also:
Constant Field Values

DEFAULT_LOG_PATH

public static final java.lang.String DEFAULT_LOG_PATH

LOG_TIMESTAMP_FORMAT

private static final java.lang.String LOG_TIMESTAMP_FORMAT

timestampFormat

private static java.text.SimpleDateFormat timestampFormat

logFile

private java.io.File logFile

logFileStream

private java.io.FileOutputStream logFileStream

logStream

private java.io.PrintStream logStream
Constructor Detail

SpotCheckLogger

private SpotCheckLogger()
Private constructor.

Method Detail

initialize

public static void initialize()
                       throws InvalidLogPathException
Opens the default log file for appending and initializes the streams.

Throws:
InvalidLogPathException

initialize

public static void initialize(java.lang.String logPath)
                       throws InvalidLogPathException
Opens the log file for appending and initializes the streams.

Parameters:
logPath - The path to the log file.
Throws:
InvalidLogPathException

print

public static void print(java.lang.String str)
Writes the given string to the log file. NOTE: initialize() must be called first or print() will have no effect.

Parameters:
str - The string to write.

println

public static void println(java.lang.String str)
Writes the given string to the log file, then writes a new line. NOTE: initialize() must be called first or println() will have no effect.

Parameters:
str - The string to write.