Logger

This is a helper class to implement logging functions for other sample classes.

Refer to the comments in the sample source for further information. The samples are located on the P8 Documentation CD or ESD image in:

   ecm_help\developer_help\process_java_api\Developer Files\samples\api

See also Running the API Samples.

Methods

General descriptions of the Logger methods follow:

Logger()

The calling program passes the name of the log file to open when invoking the Logger constructor. The constructor creates an instance of a PrintWriter object and ends by displaying the name of the output file.

displayStepElementInfo() and displayWorkObjectInfo()

The logger object displays descriptive information for Step Element or Work Object objects using Logger.displayStepElementInfo(object) or Logger.displayWorkElementInfo(object). In each method the logger assembles display lines, using VWStepElement.getParameterNames and VWStepElement.getParameterValue for step elements, and VWWorkObject.getFieldNames and VWWorkObject.getFieldValue for work objects.

log(Exception ex)

Prints a stack trace to the log file.

log(String text, Object arg1)

Writes the specified string to the log file, in a manner depending on the Object argument:

log(String text) and logAndDisplay(String text)

Logger.log(String text) writes the specified string to the log file. Logger.logAndDisplay(String text) writes the string to both the log file and stdout.