edu.wpi.cs.DSRG.xmldb.Utils
Class Log

java.lang.Object
  |
  +--edu.wpi.cs.DSRG.xmldb.Utils.Log

public class Log
extends java.lang.Object

This is a class used to output the log message to the screen. Other applications should start from level 2.


Field Summary
(package private) static boolean exact
          Used to set whether we want to see the exact level of message or we want to see all the messages higher than a certain level specificed by this.level.
(package private) static java.lang.String[] hideMethods
          The String array is used to set which show or not show the log depends on where the log is been called from.
(package private) static int level
          Used to set the lowest level of visible message.
 
Constructor Summary
Log()
           
 
Method Summary
(package private) static boolean checkHide(java.lang.String msg)
          This function will parse the msg in the format of: ' at .<...>'.
(package private) static java.lang.String getClassName(java.lang.String msg)
          It used to parse the string and get the classname out.
(package private) static java.lang.String getMethodName(java.lang.String msg)
          It used to parse the string and get the classname.method out.
(package private) static java.lang.String ignoreLogStack(java.io.BufferedReader in)
          It used to skip the information about the log functions.
static void logMessage(int the_level, java.lang.String message)
           
static void logMessage(java.lang.String message)
          Default Logger level is 1.
static void logStackTrace(int the_level, java.lang.String message)
          It will show the calling stack of this message.
static void logStackTrace(java.lang.String message)
          make a default log level 1.
static void setExact(boolean new_exact)
           
static void setLevel(int new_level)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

hideMethods

static java.lang.String[] hideMethods
The String array is used to set which show or not show the log depends on where the log is been called from. It will store the method name. So that, the methods in the list will not be debugged.

level

static int level
Used to set the lowest level of visible message.

exact

static boolean exact
Used to set whether we want to see the exact level of message or we want to see all the messages higher than a certain level specificed by this.level.
Constructor Detail

Log

public Log()
Method Detail

setLevel

public static void setLevel(int new_level)

setExact

public static void setExact(boolean new_exact)

logMessage

public static void logMessage(java.lang.String message)
Default Logger level is 1.

logMessage

public static void logMessage(int the_level,
                              java.lang.String message)

logStackTrace

public static void logStackTrace(java.lang.String message)
make a default log level 1.

logStackTrace

public static void logStackTrace(int the_level,
                                 java.lang.String message)
It will show the calling stack of this message.

ignoreLogStack

static java.lang.String ignoreLogStack(java.io.BufferedReader in)
                                throws java.io.IOException
It used to skip the information about the log functions.
Returns:
the first line of calling stack which is not of this class.

checkHide

static boolean checkHide(java.lang.String msg)
This function will parse the msg in the format of: ' at .<...>'. It will grab the classname out (with package name) and check whether the classname in the hide string. If it is, then return true, otherwise false.
Returns:
true means should hide, false means shouldn't hide.

getClassName

static java.lang.String getClassName(java.lang.String msg)
It used to parse the string and get the classname out.

getMethodName

static java.lang.String getMethodName(java.lang.String msg)
It used to parse the string and get the classname.method out.