About Debugging
GentranEx.DLL enables you to gather information from any translation session executed on the machine on which GentranEx.DLL is installed, and write that information to a log file. This function does not require any interaction from the user and thus is an efficient alternative to using the Messagebox function when debugging map.
Each entry made to the log file contains the following information, which provides clarity and readability to the log:
- date and time stamp
- name of the log owner
- source of the message
- the message
The name of the log owner, the source of the message, and the message are all supplied by the user via the OpenLog() and WriteLog() functions.
Implementing Debugging
Prog ID
"GentranEx.TraceLog"Interface ID
{7DA17F77-8090-11D2-ABE4-00C04FF3971C}
| Method | Description |
|---|---|
short OpenLog(BSTR PathFilename, BSTR
Owner, short WriteMode) |
|
short Open() |
Opens a trace log file (named "GentranTrace.log") in the GENSRVNT home directory. The file is opened in Append mode and is assigned an Owner name of "GentranEx". |
short WriteLog(BSTR Source, BSTR Message) |
|
BSTR GetLastError() |
Returns a string containing the error of the most recent attempt to open the log file. |
short CloseLog() |
Closes the log file and returns "1" for success
or "-1" for failure. Note: The file should always be closed before
your trace object goes out of scope.
|
Properties: None.
Extended rule example
This is an example of an extended rule using GentranEx.DLL for debugging.
Object obTrace;
Integer result;
String [32] szPartnerKEY;
obTrace = CreateObject ("GentranEx.TraceLog");
result = obTrace.OpenLog("D:\GENSRVNT\TraceTest.txt","ICLANA",2);
if result = -1 then
Begin
obTrace.WriteLog("Start of Log", "Trace Test");
obTrace.WriteLog("Converted TUN#",szPartnerKEY);
End
obTrace.CloseLog();
deleteobject(obTrace);