558 |
$LastLevel = $traceLevel; |
$LastLevel = $traceLevel; |
559 |
# Convert it to lower case before we hash it. |
# Convert it to lower case before we hash it. |
560 |
$category = lc $category; |
$category = lc $category; |
561 |
# Use the category and tracelevel to compute the result. |
# Validate the trace level. |
562 |
if (ref $traceLevel) { |
if (ref $traceLevel) { |
563 |
Confess("Bad trace level."); |
Confess("Bad trace level."); |
564 |
} elsif (ref $TraceLevel) { |
} elsif (ref $TraceLevel) { |
565 |
Confess("Bad trace config."); |
Confess("Bad trace config."); |
566 |
} |
} |
567 |
$retVal = ($traceLevel <= $TraceLevel && ($AllTrace || exists $Categories{$category})); |
# Make the check. Note that level 0 shows even if the category is turned off. |
568 |
|
$retVal = ($traceLevel <= $TraceLevel && ($traceLevel == 0 || $AllTrace || exists $Categories{$category})); |
569 |
} |
} |
570 |
# Return the computed result. |
# Return the computed result. |
571 |
return $retVal; |
return $retVal; |
714 |
my $key = $ENV{HTTP_X_FORWARDED_FOR} || $ENV{REMOTE_ADDR}; |
my $key = $ENV{HTTP_X_FORWARDED_FOR} || $ENV{REMOTE_ADDR}; |
715 |
$title = "Event Reported at IP address $key: $escaped"; |
$title = "Event Reported at IP address $key: $escaped"; |
716 |
$link = $SavedCGI->url(-full => 1, -query => 1); |
$link = $SavedCGI->url(-full => 1, -query => 1); |
717 |
# We need the user agent string. |
# We need the user agent string and (if available) the referrer. |
718 |
$environment = "User Agent $ENV{HTTP_USER_AGENT}." |
$environment = "User Agent $ENV{HTTP_USER_AGENT}"; |
719 |
|
if ($ENV{HTTP_REFERER}) { |
720 |
|
$environment .= " referred from $ENV{HTTP_REFERER}" |
721 |
|
} |
722 |
|
# Close off the sentence. |
723 |
|
$environment .= ". "; |
724 |
} else { |
} else { |
725 |
# No CGI object, so we're a command-line tool. Use the tracing |
# No CGI object, so we're a command-line tool. Use the tracing |
726 |
# key and the PID as the user identifier. |
# key and the PID as the user identifier. |