mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 14:38:47 +02:00
N°4756 - Ease extensibility for CRUD operations : 🎨 refactor after code review with PG
This commit is contained in:
@@ -6,46 +6,8 @@
|
||||
|
||||
namespace Combodo\iTop\Service\Events;
|
||||
|
||||
use IssueLog;
|
||||
use LogChannels;
|
||||
use utils;
|
||||
|
||||
class EventHelper
|
||||
{
|
||||
public static function Trace($sMessage)
|
||||
{
|
||||
IssueLog::Trace($sMessage, LogChannels::EVENT_SERVICE);
|
||||
}
|
||||
|
||||
public static function Debug($sMessage, $sEvent, $sources)
|
||||
{
|
||||
$oConfig = utils::GetConfig();
|
||||
$aLogEvents = $oConfig->Get('event_service.debug.filter_events');
|
||||
$aLogSources = $oConfig->Get('event_service.debug.filter_sources');
|
||||
|
||||
if (is_array($aLogEvents)) {
|
||||
if (!in_array($sEvent, $aLogEvents)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (is_array($aLogSources)) {
|
||||
if (!self::MatchEventSource($aLogSources, $sources)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
IssueLog::Debug($sMessage, LogChannels::EVENT_SERVICE);
|
||||
}
|
||||
|
||||
public static function Error($sMessage)
|
||||
{
|
||||
IssueLog::Error($sMessage, LogChannels::EVENT_SERVICE);
|
||||
}
|
||||
|
||||
public static function Warning($sMessage)
|
||||
{
|
||||
IssueLog::Warning($sMessage, LogChannels::EVENT_SERVICE);
|
||||
}
|
||||
|
||||
public static function MatchEventSource($srcRegistered, $srcEvent): bool
|
||||
{
|
||||
if (empty($srcRegistered)) {
|
||||
|
||||
Reference in New Issue
Block a user