e2e_appmon probe scripting - using the LogFile function to aid troubleshooting

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

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()
LogFile management function
The LogFile function forces the script to log each statement executed into the
specified logfile.

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

Syntax
LogFile(<filename>,<type>,<mode>)

Parameters
<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. 


Comment()
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 

Syntax
Comment(<comment_text>)

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

Remarks
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))
Instructions:
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