Class semper.util.debug.Debug
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.util.debug.Debug

java.lang.Object
   |
   +----semper.util.debug.Debug

public class Debug
extends Object
SEMPER Debugger class
Version:
$Revision: 1.6 $ $Date: 1996/06/27 17:11:47 $
Author:
Jose-Luis Abad-Peiro ([email protected])
See Also:
SemperBuyer, SemperSeller

Constructor Index

 o Debug()

Method Index

 o calling(Object, String)
Same as the previous calling() method but take an Object reference as parameter and print out the name of the object's class in addition to the message.
 o calling(String)
Log message to identify usage of a method in an object.
 o errorExit(Exception, int)
Prints an error exception message in the screen and in the log file and _terminate_.
 o errorExit(String, int)
Prints an error message in the screen and in the log file and _terminate_.
 o errorLog(Exception)
Prints an error exception message in the screen and in the log file but not _terminate_.
 o errorLog(Object, Exception)
Prints an error exception message in the screen and in the log file but not _terminate_.
 o errorLog(Object, String)
Prints an error message in the screen and in the log file but _not_ _terminate_.
 o errorLog(String)
Prints an error message in the screen and in the log file but _not_ _terminate_.
 o init()
Initialize the logging file.
 o init(String)
Change the name of the default logging file and initialize it See start() method.
 o log(Object, String)
Same as the previous log() method but take an Object reference as parameter and print out the name of the object's class in addition to the message.
 o log(String)
Write a message in the log file and NOT in the screen.
 o setMyName(String)
Sets up the user name of the module.
 o show(String)
Shows in the screen a simple message with the entity responsible pre-condition: start() method to open log file.

Constructors

 o Debug
  public Debug()

Methods

 o init
  public static synchronized void init(String newFileName)
Change the name of the default logging file and initialize it See start() method. The default log file is not used now. We use instead a file name given as argument.
Parameters:
newFileName - That's the name of the logging file to use
See Also:
previous method
 o init
  public static synchronized void init()
Initialize the logging file. It may be used at the beginning of the running application. It must be used always before using any other debug method. pre-condition: It may or may not exist the default log file. post-contidition: There is a default empty log file opened for writing. Previous files with the same name are crashed.
 o setMyName
  public static synchronized void setMyName(String myName)
Sets up the user name of the module. It must be used at the beginning of any application using the module
Parameters:
myName - The name of the user
See Also:
examples in SemperBuyer
 o log
  public static synchronized void log(String message)
Write a message in the log file and NOT in the screen. pre-condition: Somewhere at the begining of the execution thread someone has called the method start to open the log file for writing. post-condition: the string line has added to the default log file. This method uses the previous internal_log method for lack of a better way of adding lines in a text file. The procedure is not as optimized as it could be, but it works in any platform.
Parameters:
message - string to write in the default log file
 o log
  public static void log(Object o,
                         String message)
Same as the previous log() method but take an Object reference as parameter and print out the name of the object's class in addition to the message.
Parameters:
o - reference to the object calling this method -- should always be "this".
message - string to write in the default log file
 o calling
  public static synchronized void calling(String functionName)
Log message to identify usage of a method in an object. It does not show it in the screen, the method start must have been called at the beginning. All methods should have as the first line the following instruction: Debug.calling("class.method");
Parameters:
methodName - The string representing class and method
 o calling
  public static void calling(Object o,
                             String message)
Same as the previous calling() method but take an Object reference as parameter and print out the name of the object's class in addition to the message.
Parameters:
o - reference to the object calling this method -- should always be "this".
methodName - The string representing class and method
 o errorExit
  public static synchronized void errorExit(Exception excep,
                                            int exit_status)
Prints an error exception message in the screen and in the log file and _terminate_. This method will unify SEMPER error treatment.. pre-condition: start() method to open log file.
Parameters:
excep - The received exception to show in screen and in the log
exit_status - The status with which to exit file
 o errorLog
  public static void errorLog(Exception excep)
Prints an error exception message in the screen and in the log file but not _terminate_. This method will unify SEMPER error treatment.. pre-condition: start() method to open log file.
Parameters:
excep - The received exception to show in screen and in the log
 o errorLog
  public static void errorLog(Object o,
                              Exception excep)
Prints an error exception message in the screen and in the log file but not _terminate_. This method will unify SEMPER error treatment.. pre-condition: start() method to open log file.
Parameters:
o - The object generating the exception
excep - The received exception to show in screen and in the log
 o errorExit
  public static synchronized void errorExit(String message,
                                            int exit_status)
Prints an error message in the screen and in the log file and _terminate_. This method will unify SEMPER error treatment.. pre-condition: start() method to open log file.
Parameters:
exit_status - The status with which to exit
message - error message
 o errorLog
  public static synchronized void errorLog(String message)
Prints an error message in the screen and in the log file but _not_ _terminate_. This method will unify SEMPER error treatment.. pre-condition: start() method to open log file.
Parameters:
message - error message
 o errorLog
  public static synchronized void errorLog(Object o,
                                           String message)
Prints an error message in the screen and in the log file but _not_ _terminate_. This method will unify SEMPER error treatment.. pre-condition: start() method to open log file.
Parameters:
message - error message
the - object invoking the error message
 o show
  public static synchronized void show(String message)
Shows in the screen a simple message with the entity responsible pre-condition: start() method to open log file.

All Packages  Class Hierarchy  This Package  Previous  Next  Index