Put print to STDERR before logging to db because it is more reliable than db

pull/2090/head^2
Isaac Connor 2018-04-30 13:02:43 -04:00
parent 8e5ee94420
commit f4b6bde3c2
1 changed files with 2 additions and 1 deletions

View File

@ -583,6 +583,8 @@ sub logPrint {
syslog($priorities{$level}, $code.' [%s]', $string);
}
print($LOGFILE $message) if $level <= $this->{fileLevel};
print(STDERR $message) if $level <= $this->{termLevel};
if ( $level <= $this->{databaseLevel} ) {
if ( ( $this->{dbh} and $this->{dbh}->ping() ) or ( $this->{dbh} = zmDbConnect() ) ) {
@ -609,7 +611,6 @@ sub logPrint {
print(STDERR "Can't log to database: ");
}
} # end if doing db logging
print(STDERR $message) if $level <= $this->{termLevel};
} # end if level < effectivelevel
}