mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-09 02:58:23 +01:00
Update functions.lib.php
Remove useless verification on $level. Second check "in_array" line 624 is sufficient with strict mode. Otherwise "Emerg level" is not possible with "empty($level).. LOG_EMERG = 0...
This commit is contained in:
@@ -619,11 +619,9 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
|
||||
// If syslog module enabled
|
||||
if (empty($conf->syslog->enabled)) return;
|
||||
|
||||
if (! empty($level))
|
||||
{
|
||||
// Test log level
|
||||
$logLevels = array( LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG);
|
||||
if (!in_array($level, $logLevels))
|
||||
$logLevels = array(LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG);
|
||||
if (!in_array($level, $logLevels, true))
|
||||
{
|
||||
throw new Exception('Incorrect log level');
|
||||
}
|
||||
@@ -666,7 +664,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
|
||||
$loghandlerinstance->export($data,$suffixinfilename);
|
||||
}
|
||||
unset($data);
|
||||
}
|
||||
|
||||
|
||||
if (! empty($ident))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user