net.firstpartners.nounit.utility
Class Logging

java.lang.Object
  |
  +--net.firstpartners.nounit.utility.Logging

public class Logging
extends java.lang.Object

stores log of system output and system errors If Servlet , writes to Servlet Log File. If non-Servlet , writes to Output Files Specified in parameters.
Class is mainly static , to allow ease of use (one one log file per system!!) , but has a non-static constructor (for use by servlets - so reference to servlet log file can be set.


Constructor Summary
Logging(javax.servlet.ServletContext inServletContext)
          Constructor for Logging from Servlet
 
Method Summary
static void debug(java.lang.Object object)
          Prints debug message to system log file.
static void printError(java.lang.Object sysErr)
          Print log of system errors This method catches java.io.IOExceptions internally , so as to give a similar method signature to System.out.println.
static void printOutput(java.lang.Object sysOut)
          Print log of system output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logging

public Logging(javax.servlet.ServletContext inServletContext)
        throws java.io.IOException
Constructor for Logging from Servlet
Parameters:
inServletContext - used to get access to the Servlet log files
Throws:
java.io.IOException - if it can't create log files
Method Detail

printOutput

public static void printOutput(java.lang.Object sysOut)
Print log of system output
Parameters:
sysOut -  

printError

public static void printError(java.lang.Object sysErr)
Print log of system errors This method catches java.io.IOExceptions internally , so as to give a similar method signature to System.out.println. Also should we stop system if logging (and only logging) fails?
Parameters:
sysErr -  

debug

public static void debug(java.lang.Object object)
Prints debug message to system log file. Catches java.io.IOExceptions internally, so as to give a similar method signature to System.out.println.
Parameters:
object - Object containing information to display