Following are four examples on using my-logit in your code.
logit(1,__LINE__, “some data”);
logit(2,__LINE__, $myVariable);
logit(3,__FILE__, “my data: $myVariable”);
logit(4,””,”<h3>Log File: $logfile</h3>”);
- The first example shows just placing some data in the log file.
- The second example will print a variable in the log file.
- The third example will both data and variable in the log file.
- The fourth example uses html coding, data, and variable in the log file.
Here is a code snippet showing the calls to logit using file number 1.
$result = false;
$result = add_option ($active, $live, ”, ‘yes’);
if ($result) {
logit(1,__LINE__, “Option $active added…” );
} else {
logit(1,__LINE__, “Unable to add database element option: ” . $active );
}