mirror of
https://github.com/jbcr/Win32ServiceBundle.git
synced 2026-03-24 08:52:10 +01:00
31 lines
606 B
PHP
31 lines
606 B
PHP
<?php
|
|
/**
|
|
* @copyright Macintoshplus (c) 2019
|
|
* Added by : Macintoshplus at 20/02/19 09:09
|
|
*/
|
|
|
|
namespace Win32ServiceBundle\Logger;
|
|
|
|
|
|
use Symfony\Contracts\EventDispatcher\Event;
|
|
|
|
class ThreadNumberProcessor
|
|
{
|
|
private ?int $threadNumber = null;
|
|
|
|
public function setThreadNumber(Event $evt): void {
|
|
if (!$evt instanceof ThreadNumberEvent) {
|
|
return;
|
|
}
|
|
$this->threadNumber = $evt->getThreadNumber();
|
|
}
|
|
|
|
|
|
public function __invoke(array $record): array
|
|
{
|
|
$record['extra']['threadNumber'] = $this->threadNumber;
|
|
return $record;
|
|
}
|
|
|
|
}
|