Merge branch '3366-mensajes-ejecutar-pandora_db' into 'develop'
Solved an issue with uninizialized variable See merge request artica/pandorafms!2815
This commit is contained in:
commit
2d801a0109
|
@ -652,15 +652,18 @@ sub logger ($$;$) {
|
||||||
} else {
|
} else {
|
||||||
# Obtain the script that invoke this log
|
# Obtain the script that invoke this log
|
||||||
my $parent_caller = "";
|
my $parent_caller = "";
|
||||||
if (($parent_caller = ( caller(2) )[1]) ne "") {
|
$parent_caller = ( caller(2) )[1];
|
||||||
|
if (defined $parent_caller) {
|
||||||
$parent_caller = (split '/', $parent_caller)[-1];
|
$parent_caller = (split '/', $parent_caller)[-1];
|
||||||
$parent_caller =~ s/\.[^.]+$//;
|
$parent_caller =~ s/\.[^.]+$//;
|
||||||
$parent_caller = " ** " . $parent_caller . " **:";
|
$parent_caller = " ** " . $parent_caller . " **: ";
|
||||||
|
} else {
|
||||||
|
$parent_caller = " ";
|
||||||
}
|
}
|
||||||
open (FILE, ">> $file") or die "[FATAL] Could not open logfile '$file'";
|
open (FILE, ">> $file") or die "[FATAL] Could not open logfile '$file'";
|
||||||
# Get an exclusive lock on the file (LOCK_EX)
|
# Get an exclusive lock on the file (LOCK_EX)
|
||||||
flock (FILE, 2);
|
flock (FILE, 2);
|
||||||
print FILE strftime ("%Y-%m-%d %H:%M:%S", localtime()) . $parent_caller . " " . (defined($pa_config->{'servername'}) ? $pa_config->{'servername'} : '') . " [V". $level ."] " . $message . "\n";
|
print FILE strftime ("%Y-%m-%d %H:%M:%S", localtime()) . $parent_caller . (defined($pa_config->{'servername'}) ? $pa_config->{'servername'} : '') . " [V". $level ."] " . $message . "\n";
|
||||||
close (FILE);
|
close (FILE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue