Open SiteSearch 4.1.1
Final

ORG.oclc.log
Class Log

java.lang.Object
  |
  +--ORG.oclc.log.Log
Direct Known Subclasses:
ServerLog, UserLog

public abstract class Log
extends Object

The Log class defines common logging calls and abstract methods that must be implemented by each type of logging class. It also defines log levels that the logging classes will recognize.


Field Summary
static Log out
           
static int TRACE_ALL
           
static int TRACE_ALL_ON
           
static int TRACE_ARCHIVE
           
static int TRACE_CERTIFIED
           
static int TRACE_CRITICAL
           
static int TRACE_ENTERS_AND_EXITS
           
static int TRACE_FATAL
           
static int TRACE_HOUSEKEEPING
           
static int TRACE_INFO
           
static int TRACE_MSGS
           
static int TRACE_NONE
           
static int TRACE_PARMS
           
static int TRACE_READ_MSGS
           
static int TRACE_WARNING
           
static int TRACE_WRITE_MSGS
           
protected  int traceLevel
          integer data type defining current trace level for the log object.
 
Constructor Summary
Log()
           
 
Method Summary
abstract  void close()
          Close the log.
abstract  PrintStream getLogfile()
          Retrieves the PrintStream object for the logfile.
 int getTraceLevel()
          Retrieves the current Trace Level setting.
static String getTraceLevelString(int traceInt)
          Decodes the input trace integer values to a string representing the trace level
abstract  void open()
          Open the log file with the existing id string, logname, and logDirectory.
abstract  void open(String id, String logName, String logDir)
          Open the log file using the input id string, logname, and logDirectory.
static int parseTraceLevel(String traceString)
          Decodes the input traceString values to a numeric value.
abstract  void printError(Object reporter, int errorSeverity, Throwable excep, String shortDescription, String otherDescription)
          Print Errors to the log.
 void println(int traceType, Object msg)
          Prints the input object to the log if the input trace level is turned on
 void println(int traceType, String msg)
          Prints the input message text to the log, if the input trace level is turned on
 void println(int traceType, String fromClass, Object msg)
          Prints the input object and the class from which it was called to the log if the input trace level is turned on
 void println(int traceType, String fromClass, String msg)
          Prints the input message text and the class from which it was called to the log if the input trace level is turned on
 void println(Object msg)
          Prints the input object to the log.
 void println(String msg)
          Prints the input message text to the log.
 void println(String fromClass, Object msg)
          Prints the input object and the class from which it was called to the log.
 void println(String fromClass, String msg)
          Prints the input message text and the class from which it was called to the log.
 void putTraceLevel(int newTraceLevel)
          Sets the current Trace Level setting to the input integer.
 void putTraceLevel(String traceString)
          Sets the current Trace Level setting to the string representation of the trace level (TRACE_NONE for example).
abstract  void rollOver(long currentTime)
          Shuts/Re-opens the log file.
abstract  void setName(String id, String logName, String logDir)
          Sets the log filename variables to the input id string, logname, and logDirectory.
static void setOut(String server)
          Opens a stdout file for the input server name.
abstract  void setrollOverTime(int time)
          Sets the userlog rollover time - currently not used.
 boolean traceOn(int traceType)
          Tests to see if the input trace level is currently on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

public static Log out

traceLevel

protected int traceLevel
integer data type defining current trace level for the log object.

TRACE_NONE

public static final int TRACE_NONE

TRACE_ENTERS_AND_EXITS

public static final int TRACE_ENTERS_AND_EXITS

TRACE_PARMS

public static final int TRACE_PARMS

TRACE_MSGS

public static final int TRACE_MSGS

TRACE_READ_MSGS

public static final int TRACE_READ_MSGS

TRACE_WRITE_MSGS

public static final int TRACE_WRITE_MSGS

TRACE_ALL

public static final int TRACE_ALL

TRACE_CERTIFIED

public static final int TRACE_CERTIFIED

TRACE_CRITICAL

public static final int TRACE_CRITICAL

TRACE_FATAL

public static final int TRACE_FATAL

TRACE_WARNING

public static final int TRACE_WARNING

TRACE_INFO

public static final int TRACE_INFO

TRACE_ARCHIVE

public static final int TRACE_ARCHIVE

TRACE_HOUSEKEEPING

public static final int TRACE_HOUSEKEEPING

TRACE_ALL_ON

public static final int TRACE_ALL_ON
Constructor Detail

Log

public Log()
Method Detail

open

public abstract void open(String id,
                          String logName,
                          String logDir)
Open the log file using the input id string, logname, and logDirectory.
Parameters:
id - the text to start the filename with
logName - the common part of the filename
logDir - the directory for the filename

open

public abstract void open()
Open the log file with the existing id string, logname, and logDirectory.

setName

public abstract void setName(String id,
                             String logName,
                             String logDir)
Sets the log filename variables to the input id string, logname, and logDirectory.
Parameters:
id - the text to start the filename with
logName - the common part of the filename
logDir - the directory for the filename

close

public abstract void close()
Close the log.

setrollOverTime

public abstract void setrollOverTime(int time)
Sets the userlog rollover time - currently not used.
Parameters:
time - the rollover time in seconds.

getLogfile

public abstract PrintStream getLogfile()
Retrieves the PrintStream object for the logfile.
Returns:
PrintStream

rollOver

public abstract void rollOver(long currentTime)
Shuts/Re-opens the log file.
Parameters:
currentTime - the current time in milliseconds.

printError

public abstract void printError(Object reporter,
                                int errorSeverity,
                                Throwable excep,
                                String shortDescription,
                                String otherDescription)
Print Errors to the log.
Parameters:
reporter - the object reporting the error
errorSeverity - the Code for the severity of the Error
excep - an the Exception or Throwable object
shortDescription - a short textual description of the error
otherDescription - any text that can add additional information to describe the error.

println

public final void println(String fromClass,
                          String msg)
Prints the input message text and the class from which it was called to the log.
Parameters:
fromClass - the name of the class invoking the print
msg - the text to print

println

public final void println(String msg)
Prints the input message text to the log.
Parameters:
msg - the text to print

println

public final void println(String fromClass,
                          Object msg)
Prints the input object and the class from which it was called to the log.
Parameters:
fromClass - the name of the class invoking the print
msg - the object to print

println

public final void println(Object msg)
Prints the input object to the log.
Parameters:
msg - the object to print

println

public final void println(int traceType,
                          String fromClass,
                          String msg)
Prints the input message text and the class from which it was called to the log if the input trace level is turned on
Parameters:
traceType - the trace level to compare to
fromClass - the name of the class invoking the print
msg - the text to print

println

public final void println(int traceType,
                          String msg)
Prints the input message text to the log, if the input trace level is turned on
Parameters:
traceType - the trace level to compare to
msg - the text to print

println

public final void println(int traceType,
                          String fromClass,
                          Object msg)
Prints the input object and the class from which it was called to the log if the input trace level is turned on
Parameters:
traceType - the trace level to compare to
fromClass - the name of the class invoking the print
msg - the object to print

println

public final void println(int traceType,
                          Object msg)
Prints the input object to the log if the input trace level is turned on
Parameters:
traceType - the trace level to compare to
msg - the object to print

getTraceLevel

public final int getTraceLevel()
Retrieves the current Trace Level setting.
Returns:
int

putTraceLevel

public final void putTraceLevel(int newTraceLevel)
Sets the current Trace Level setting to the input integer.
Parameters:
newTraceLevel - the new trace level

putTraceLevel

public final void putTraceLevel(String traceString)
Sets the current Trace Level setting to the string representation of the trace level (TRACE_NONE for example).
Parameters:
traceString - the new trace level

traceOn

public final boolean traceOn(int traceType)
Tests to see if the input trace level is currently on.
Parameters:
traceType - the trace level to test against
Returns:
boolean

parseTraceLevel

public static final int parseTraceLevel(String traceString)
Decodes the input traceString values to a numeric value.
Parameters:
traceString - a list of trace levels such as TRACE_MSGS+TRACE_ENTERS_AND_EXITS
int - the numeric trace level

getTraceLevelString

public static String getTraceLevelString(int traceInt)
Decodes the input trace integer values to a string representing the trace level
Parameters:
traceInt - the input trace level
String - for the trace level such as TRACE_MSGS

setOut

public static void setOut(String server)
Opens a stdout file for the input server name.
Parameters:
server - the name of the server to open the file for

Open SiteSearch 4.1.1
Final