CodeExplorer addRecord example
$innerEvent =
$event->
getEvent();
$additionalData =
[];
$logLevel = Level::Debug;
if ($innerEvent instanceof LogAware
) { $logLevel =
$innerEvent->
getLogLevel();
$additionalData =
$innerEvent->
getLogData();
} $this->logger->
addRecord( $logLevel,
$innerEvent->
getName(),
[ 'source' => 'core',
'environment' =>
$this->environment,
'additionalData' =>
$additionalData,
] );
} public static function getSubscribedEvents(): array
{ public function trace($label) { $this->
log(BaseLogger::DEBUG,
$label,
['trace' => true
]);
} public function addRecord(int
$level, string
$message, array
$context =
[], ?DateTimeImmutable
$datetime = null
): bool
{ $message =
str_replace(['[', ']'
],
['(', ')'
],
$message);
return parent::
addRecord($level,
$message,
$context,
$datetime);
}}