e2e_appmon probe scripting - using the LogFile function to aid troubleshooting

Document ID : KB000097283
Last Modified Date : 21/05/2018
Show Technical Document Details

The WinTask Scripting language contains functions that can aid in debugging problematic scripts being executed by
   the e2e_appmon probe. Two functions in particular LogFile() and Comment() can help aid in troubleshooting issues
   such as timing, checking to see if IF / ELSE condition blocks  are executed, as well as check how long a statement
   took to execute.

LogFile management function
The LogFile function forces the script to log each statement executed into the
specified logfile.

Mainly used to trace in a text file all the statements executed by the script.


<filename>: name of the file where the statements executed after this function
are written. The extension must be .LOG if you want to be able to open the logfile
using File/Open Log menu. If the full path is not included in <filename>, the
file is created in the scripts current directory.

<type>: 1 for a full logfile, 0 for a limited logfile (only statements Comment are
written into the logfile).

<mode>: 1 to delete the logfile before writing, 0 to add the new statements at
the end of the logfile. 

Logfile management function.
The Comment function writes a comment to the log file. (This inserts a comment into
  the LogFile opened using the LogFile function for tracing 


<comment_text>: string to write to the log file.

You must have already opened a log file before writing comments.
To write a complex string in the log file, you can concatenate multiple strings
using the + operator and you can use str$ function to transform an integer in a
string. For example:
 Comment("The result for i index is: "+ str$(i))
Add the LogFile() function call and if desired Comment() calls into the script and recompile. The next execution should then
  generate a log file showing all the executed statements along with the timestamp of execution.

Example usage

e2e_appmon script - LogFile() Function

e2e_appmon script - LogFile() Function Output Sample