This script manages emergency tracing. Emergency tracing is controlled by a file in the FIG temporary directory containing trace information. It enables developers to turn on tracing without the cumbersome requirement for adding parameters to the URL. This method does not do the tracing, it merely sets up data structures that allow tracing to take place without explicit authorization from form or command-line parameters.
This script supports the following CGI query parameters.
Trace level and list of trace modules to turn on, space-delimited. The default is no tracing.
Level at which to turn on emergency tracing, generally a number from 0 through 4.
A list of trace packages to activate. This parameter can be multiply-occurring, or you can pass in a set of package names separated by spaces.
Type of tracing to use: WARN to trace to the server error log, QUEUE to
queue output to the web page, FILE to write to a temporary file, or
APPEND to append to a temporary file.
Number of hours to leave emergency tracing active. Note that for web services, tracing will turn off automatically at the end of the web session when the cookie is erased.
If specified, emergency tracing is turned on and any existing trace file will be deleted.
If specified, emergency tracing is turned off.
If specified, the trace file is displayed in the output.
my $html = CloseLine($traceMode);
Close off the current output line for the trace file display.
1 if we are processing trace lines, 0 if we are processing text lines,
2 if we are between rows of the table.
Returns the HTML for closing off the current line.
my $newTraceMode = ProcessLine($line, $traceMode);
Process and display a line from the trace file.
The line to display. This may be either a trace line, with date, module name, and message, or a data line, with just plain data.
The current display mode: 0 is line mode, meaning we have been writing data
lines. 1 is trace mode, meaning we have been writing trace lines. 2 is start
mode, meaning we are between rows. The importance here is that the display mode
tells us what we did with the previous line, and determine how we will separate
the new line from the old one. A trace line represents a table row, while a data
line is part of the previous trace line's message. See also CloseLine.
Returns 0 if the incoming line was a data line and 1 if it was a trace
line. This value should be used as the traceMode value for the next call.