Merge pull request #32383 from atm-etienne/fix/130/remove_dol_syslog_throws

Fix/130/remove dol syslog throws
This commit is contained in:
Laurent Destailleur 2024-12-19 18:10:38 +01:00 committed by GitHub
commit 37f3fccc35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1658,8 +1658,10 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
if (!empty($message)) {
// Test log level
$logLevels = array(LOG_EMERG=>'EMERG', LOG_ALERT=>'ALERT', LOG_CRIT=>'CRITICAL', LOG_ERR=>'ERR', LOG_WARNING=>'WARN', LOG_NOTICE=>'NOTICE', LOG_INFO=>'INFO', LOG_DEBUG=>'DEBUG');
if (!array_key_exists($level, $logLevels)) {
throw new Exception('Incorrect log level');
dol_syslog('Error Bad Log Level '.$level, LOG_ERR);
$level = $logLevels[LOG_ERR];
}
if ($level > $conf->global->SYSLOG_LEVEL) {
return;