sometimes you shouldn't call log_it()...

a warn/die may happen even before setup_environment() has been called,
so then log_it() tries to use uninitialised variables and it then adds
to the confusion complaining about *those*
This commit is contained in:
Sitaram Chamarty 2011-06-08 11:43:07 +05:30
parent 436662f28f
commit 7a0f517afe

View file

@ -57,13 +57,13 @@ BEGIN {
$SIG{__DIE__} = sub { $SIG{__DIE__} = sub {
my $msg = join(' ', "Die generated at line", (caller)[2], "in", (caller)[1], ":", @_, "\n"); my $msg = join(' ', "Die generated at line", (caller)[2], "in", (caller)[1], ":", @_, "\n");
$msg =~ s/[\n\r]+/<<newline>>/g; $msg =~ s/[\n\r]+/<<newline>>/g;
log_it($msg); log_it($msg) if $ENV{GL_LOG};
}; };
$SIG{__WARN__} = sub { $SIG{__WARN__} = sub {
my $msg = join(' ', "Warn generated at line", (caller)[2], "in", (caller)[1], ":", @_, "\n"); my $msg = join(' ', "Warn generated at line", (caller)[2], "in", (caller)[1], ":", @_, "\n");
$msg =~ s/[\n\r]+/<<newline>>/g; $msg =~ s/[\n\r]+/<<newline>>/g;
log_it($msg); log_it($msg) if $ENV{GL_LOG};
warn @_; warn @_;
}; };
} }