SandMark version 2.0


sandmark.util
Class Log

java.lang.Object
  |
  +--sandmark.util.Log

public class Log
extends java.lang.Object

The sandmark.util.Log class handles logging for a SandMark application. Logging is considered a global aspect of the program, and all methods are static.

Every message has a level associated with it. Only messages meeting a specified threshold are seen by the user. Levels are TBD. #%#%#%#%#%#%

Multiple log files can be specified, each with its own threshold. Each message is logged to every file with an accepting threshold. #%#%#%# (THAT IS TBD. ONLY ONE FILE WORKS NOW.)


Field Summary
(package private) static SandMarkFrame frame
           
 
Constructor Summary
Log()
           
 
Method Summary
static void message(int level, java.lang.String msg)
          Sends a message to the log files.
static void message(int level, java.lang.String msg, java.lang.Throwable t)
          Sends an exception message to the log files.
static void setLog(java.io.OutputStream o, int thresh)
          Registers an output stream for logging.
static void setLog(SandMarkFrame f, int thresh)
          Registers a SandMarkFrame to receive log messages.
static void setLog(java.lang.String fname, int thresh)
          Opens and registers an output file for logging.
static void setLog(java.io.Writer w, int thresh)
          Registers an output writer for logging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

static SandMarkFrame frame
Constructor Detail

Log

public Log()
Method Detail

setLog

public static void setLog(java.lang.String fname,
                          int thresh)
                   throws java.io.IOException
Opens and registers an output file for logging.

Parameters:
fname - filename for output
thresh - message threshold
java.io.IOException

setLog

public static void setLog(java.io.OutputStream o,
                          int thresh)
Registers an output stream for logging.

Parameters:
thresh - message threshold

setLog

public static void setLog(java.io.Writer w,
                          int thresh)
Registers an output writer for logging.

Parameters:
w - output stream
thresh - message threshold

setLog

public static void setLog(SandMarkFrame f,
                          int thresh)
Registers a SandMarkFrame to receive log messages.

Parameters:
f - parent window
thresh - message threshold

message

public static void message(int level,
                           java.lang.String msg)
Sends a message to the log files. The message is sent to every log file that does not have a threshold higher than the stated message level.

Parameters:
level - message level
msg - message text

message

public static void message(int level,
                           java.lang.String msg,
                           java.lang.Throwable t)
Sends an exception message to the log files.

Parameters:
level - message level
msg - message text

SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002