-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLogger.php
More file actions
39 lines (33 loc) · 833 Bytes
/
Logger.php
File metadata and controls
39 lines (33 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* @copyright Copyright (C) 2024 Combodo SAS
* @license https://www.combodo.com/documentation/combodo-software-license.html
*
*/
namespace Combodo\iTop\Extension\Saml;
use IssueLog;
use MetaModel;
/**
* Simple logger to write to log/saml.log
*/
class Logger extends IssueLog
{
public const CHANNEL_DEFAULT = 'SAML';
public const LEVEL_DEFAULT = self::LEVEL_ERROR;
private static $bDebug = null;
public static function GetMinLogLevel($sChannel, $sConfigKey = self::ENUM_CONFIG_PARAM_FILE)
{
if ($sChannel === static::CHANNEL_DEFAULT)
{
if (static::$bDebug === null)
{
static::$bDebug = MetaModel::GetModuleSetting('combodo-saml', 'debug', false);
}
if (static::$bDebug)
{
return static::LEVEL_TRACE;
}
}
return parent::GetMinLogLevel($sChannel, $sConfigKey);
}
}