 |
File MainApplication.java:
/*
* Class Name: MainApplication
*
* Purpose: Sample application to demonstrate tracing
*
* Owner:
* Version: 1.0
*/
public class MainApplication
{
public static void main(String[] args)
{
/* Before executing a trace output call, issue a check to see if */
/* run-time tracing has been turned on */
/* Run-time trace example */
if ( PrintMessage.isRuntimeDebugOn() )
{
PrintMessage.printMessageWithDateTime("main(): Run-time message 1");
}
/* Combining run-time trace output calls with exceptions can be */
/* an effective trace strategy. */
/* Run-time trace example */
try { throw new Exception("error"); }
catch (Throwable t)
{
if ( PrintMessage.isRuntimeDebugOn() )
{
PrintMessage.printMessage("main(): Run-time message 2");
t.printStackTrace();
}
}
} /*end main() */
} /* end class definition */
|
Return to the
article.
|  |
|