Logging is about the only effective means you have to debug WebLoad Agenda
scripts--too little information during development makes getting the
script to initially run almost impossible. But once the script is
debugged you often are then overrun with log messages when the
script is run with hundreds or even thousands of virtual clients.

This posting contains a standalone Agenda which demonstrates some useful
logging functions used to control how much or little information gets
logged, and to ensure that each message which is logged is tagged
with its assocated virtual client and round number.

Four mechanisms control message logging with these special functions:
<UL TYPE=SQUARE>
<LI> A global variable, VERBOSE, is a number which conditions how much
info message "verbosity" you want logged--the larger the number the more
info messages that are logged. While value definitions can be left up
to each Agenda programmer, I recommend that you standarize across all
WebLoad projects in your department.

<LI> A global variable, bOnlyClient0Info, controls whether only virtual
client #0 logs info messages (== true), or whether all virtual client's
log info messages (== false). (Info message logging is still subject
to above described VERBOSE level conditioning).

<LI> The test code never calls any of the WebLoad logging functions directly,
these are: InfoMessage(), WarningMessage(), SevereErrorMessage() and
ErrorMessage(). Rather test code must call their equivalents which
are LogInfoMsg(), LogWarningMsg(), LogSevereErrorMsg(), and
LogErrorMsg(). The only special logging function which requires
extra parameters is LogInfoMsg(), which requires you to specify the
message's verbose level.

<LI> Each virtual client maintains a local string, wlLocals.tr_info, which
is initialized with its thread and round numbers at the start of each
iteration of test execution, in the form [x/y] message...,
where x = ThreadNum and y = RoundNum.[/list]

With these mechanisms in place you can easily control the flow of
logging information.

And, if you find cutting and pasting the following code example (which
gets pretty mucked up when added to one of these postings) is a problem
then email me and I will reply with the source code attached to the reply.

<UL TYPE=SQUARE>
<LI> Terry Horwath
The Carl Group
thorwath@pacbell.net
408/733-9775[/list]



[This message has been edited by Terry Horwath (edited 08-28-1999).]