mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Adding more debug code to make my life easier.
This commit is contained in:
parent
6c91eb5274
commit
574e9443e3
@ -28,8 +28,9 @@
|
||||
|
||||
package PLIF;
|
||||
use strict; # require strict adherence to perl standards
|
||||
use vars qw($AUTOLOAD); # it's a package global
|
||||
use vars qw($AUTOLOAD); # it's a package global
|
||||
use Carp qw(cluck confess); # stack trace versions of warn and die
|
||||
use POSIX qw(strftime); # timestamps in debug output
|
||||
my $DEBUG = 9; # level of warnings and dumps to print to STDERR (none go to user)
|
||||
my $USER = 1; # level of errors to report to user (all go to STDERR)
|
||||
my @FATAL = (); # a list of pointers to functions that want to report errors to the user
|
||||
@ -187,8 +188,9 @@ sub dump {
|
||||
my $self = shift;
|
||||
my($level, @data) = @_;
|
||||
if ($self->isAtDebugLevel($level)) {
|
||||
my $time = strftime('%Y-%m-%d %H:%M:%S UTC', gmtime());
|
||||
foreach (@data) {
|
||||
print STDERR "$0: ($level) $_\n";
|
||||
print STDERR "$0.$$ \@ $time: ($level) $_\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,8 +43,9 @@ sub applies {
|
||||
sub decodeHTTPArguments {
|
||||
my $self = shift;
|
||||
if (defined($ENV{'QUERY_STRING'})) {
|
||||
$self->dump(9, 'HTTP GET. Input was: ' . $ENV{'QUERY_STRING'});
|
||||
$self->splitURLEncodedForm($ENV{'QUERY_STRING'}, sub { $self->addArgument(@_); })
|
||||
} else {
|
||||
# XXX no arguments
|
||||
$self->dump(9, 'HTTP GET. No input.');
|
||||
}
|
||||
}
|
||||
|
@ -64,6 +64,8 @@ sub decodeHTTPArguments {
|
||||
}
|
||||
# XXX END OF PLATFORM SPECIFIC CODE XXX
|
||||
|
||||
$self->dump(9, 'HTTP POST. Input was in multipart/form-data format.');
|
||||
|
||||
# parse the MIME body
|
||||
local $/ = undef;
|
||||
my $entity = $parser->parse_data('Content-Type: ' . $self->CONTENT_TYPE . "\n" .
|
||||
|
@ -46,5 +46,6 @@ sub decodeHTTPArguments {
|
||||
my $self = shift;
|
||||
local $/ = undef;
|
||||
my $input = <STDIN>;
|
||||
$self->dump(9, 'HTTP POST. Input was: ' . $input);
|
||||
$self->splitURLEncodedForm($input, sub { $self->addArgument(@_); })
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user