 |
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)
{
/* Each of the following examples show how to code calls to the */
/* development-time trace mechanism. Each call first checks the value */
/* of the trace variable, by direct call to the public variables */
/* themselves. */
/* Development time trace example */
if ( PrintMessage.traceLow )
{
PrintMessage.printMessageWithDateTime("main():Develop-time message1");
}
/* Development time trace example */
if ( PrintMessage.traceMedium )
{
PrintMessage.printMessageWithDateTime("main():Develop-time message2");
}
/* Development time trace example */
if ( PrintMessage.traceHigh )
{
PrintMessage.printMessageWithDateTime("main():Develop-time message3");
}
/* Development time trace example */
try { throw new Exception("error"); }
catch (Throwable t)
{
if ( PrintMessage.traceAll )
{
PrintMessage.printMessage("main(): Development-time message 4");
t.printStackTrace();
}
}
} /*end main() */
} /* end class definition */
|
Return to the
article.
|  |
|