31 lines
785 B
PHP
31 lines
785 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KupShop\SynchronizationBundle\Util;
|
|
|
|
use KupShop\KupShopBundle\Util\Logging\SentryLogger;
|
|
use KupShop\SynchronizationBundle\Logger\SynchronizationLogger;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
class SynchronizationLoggerFactory
|
|
{
|
|
public function __construct(
|
|
private readonly LoggerInterface $logger,
|
|
private readonly SentryLogger $sentryLogger,
|
|
) {
|
|
}
|
|
|
|
public function create(array $activityLogExceptions = [], ?string $logPrefix = null): SynchronizationLogger
|
|
{
|
|
$logger = new SynchronizationLogger(
|
|
$this->logger,
|
|
$this->sentryLogger
|
|
);
|
|
|
|
return $logger
|
|
->withLogPrefix($logPrefix)
|
|
->withActivityLogExceptions($activityLogExceptions);
|
|
}
|
|
}
|