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:
parent
436662f28f
commit
7a0f517afe
|
@ -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 @_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue