Log : rename config parameter from 'min_log_level' to 'log_level_min'

This commit is contained in:
Pierre Goiffon
2019-12-10 09:46:42 +01:00
parent 332c6eb33c
commit 18db31f138
2 changed files with 18 additions and 12 deletions

View File

@@ -99,11 +99,11 @@ class Config
* @since 2.7.0 export_pdf_font param
*/
protected $m_aSettings = array(
'min_log_level' => array(
'log_level_min' => array(
'type' => 'array',
'description' => 'min log level',
'default' => 'Ok',
'value' => 'Ok',
'description' => 'Optional min log level per channel',
'default' => '',
'value' => '',
'source_of_value' => '',
'show_in_conf_sample' => false,
),

View File

@@ -358,25 +358,31 @@ abstract class LogAPI
private static function GetMinLogLevel($sChannel)
{
$oConfig = \MetaModel::GetConfig();
if (! $oConfig instanceof Config)
if (!$oConfig instanceof Config)
{
return self::LEVEL_OK;
}
$sMinLogLevel = $oConfig->Get('min_log_level');
if (! is_array($sMinLogLevel))
$sLogLevelMin = $oConfig->Get('log_level_min');
if (empty($sLogLevelMin))
{
return $sMinLogLevel;
return self::LEVEL_OK;
}
if (isset($sMinLogLevel[$sChannel]))
if (!is_array($sLogLevelMin))
{
return $sMinLogLevel[$sChannel];
return $sLogLevelMin;
}
if (isset($sMinLogLevel[static::CHANNEL_DEFAULT]))
if (isset($sLogLevelMin[$sChannel]))
{
return $sMinLogLevel[$sChannel];
return $sLogLevelMin[$sChannel];
}
if (isset($sLogLevelMin[static::CHANNEL_DEFAULT]))
{
return $sLogLevelMin[$sChannel];
}
return self::LEVEL_OK;