Example: lr_log_message

In the following example, lr_log_message sends a message to the log file if the connection to the server fails.

char* abort="aborting...";
...
if (init() < 0) {
    lr_log_message ("login failed: %s", abort);}
   return(0);
}

In the next example, an Iteration Number type parameter called "iteration" was defined in VuGen. The lr_log_message function sends a message indicating the current iteration number.

lr_log_message( "We are on iteration #%s", lr_eval_string( "{iteration}" ) );