fwpUtil
Class LogIt

public class LogIt
extends javax.swing.JDialog
Title: A dialog to setup and control logging actions within a program.

This is a small logger capability which was originally written in Pascal and subsequently re-written in C, Ada and now Java. Though vastly smaller than the Java version, it performs the essential logging functions. For compatibility the names of the logging levels were made the same as those used in the Java logger.

Under normal circumstances, a user will not have any reason to use the functions supported by this dialog. As you will see from the following description, the capabilities provide here are of use primarily during program development and testing. However, they are also of critical use when a user runs into a program error or malfunction.

When the users run into a problem, they need to record what they did to create the problem. In other words, they need to provide the program developer with an accurate description of exactly what menu selections they made, what keys they pressed, and what inputs they made. This can be a time consuming task, especially if there are several ways in which The error can be created.

The capabilities provided here make this a whole lot easier. When the program starts the logging function is normally turned "OFF". Should the user encounter a problem, or is curious about its internal operation; they can come to this dialog and turn on the logging activities. To see how this all works, the user simply performs the following steps:

1. Click the “ALL” radio button at the bottom the Log Levels radio buttons. This will capture the maximum amount of internal information. It will also erase any old log file which may exist and start a new one.

2. Click the Read the log file button. The log file display window will display a list of actions which have taken place up to this point. The list will look something like the following:

Default LogFile = C:\MicroMap\Log.txt
MainWindowFrame entering constructor
MainWindowFrame entering jbInit
MainWindowFrame exiting jbInit
MainWindowFrame exiting constructor
MainWindowFrame jMenuHelpLog_actionPerformed
LogIt entering constructor
LogIt entering jbInit
Logger getLogFilePath = C:\MicroMap\
Logger getLogFileName = Log.txt
Loading file C:\MicroMap\HelpFiles\LogFileHelp.htm
File C:\MicroMap\HelpFiles\LogFileHelp.htm loaded
LogIt jRadioALL_actionPerformed
LogIt jButtonReadLogFile_actionPerformed
TextViewer file load started.
Loading file C:\MicroMap\Log.txt

This information can be very important when trying to figure out what went wrong in the program. Notice that the location and name of the log file is displayed in the title bar of the window.

2. Click the Done button on the window.

3. Click the Add environment variables button. This will add quite a bit of internal system information to the log file.

4. Click the Read the log file button again. Now the user will see that a large amount of additional information is in the file. Note: the viewer always places the user at the end of the log file so they can automatically see the most recent additions to the file.

5. Click the Done button again to close the window.

6. Click the “OFF” radio button to turn off the logging and then the Done button to close the Program Logging window.

The user can turn the logging function on or off at any time during their use of the program. They can also change the level of logging at any time.

A copy of the default LogItHelp.htm file is located in the fwpUtil package directory.

Copyright: Copyright (c) 2011

Version:
1.0
Author:
Fred Pospeschil - This file is placed in the public domain and can be used and adapted without restrictions. The user of the code is totally responsible for insuring its suitability in the intended application.

NOTE: This JavaDoc file was post processed with Microsoft FrontPage and regenerating the file will cause the graphics and format changes to be lost.
Constructor Detail

LogIt

public LogIt(java.awt.Frame parent)
The Dialog allows the user to set the desired level of program data logging. Thru this dialog the user can set the logging level to one of the following:

OFF,
SEVERE,
WARNING,
INFO, CONFIG,
FINE,
FINER,
FINEST, or
ALL.

The dialog displays the full path\file name of the log file.

The user can also display the log and associated help files.


Method Detail

toString

public java.lang.String toString()
Returns the name of the class.
Returns:
The class name, log file path+name, log level and log help file path+name. For example:

LogIt LogFile=D:\A JOptionPanel\Log.txt Log Level=1 HelpFile=D:\A JOptionPanel\LogItHelp.htm