Skip to content

Commit 67cd072

Browse files
committed
Add logger
1 parent bc3467c commit 67cd072

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

Classes/Controller/SearchController.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ class SearchController extends ActionController
4646

4747
protected ?object $searchProvider = null;
4848

49-
private readonly LoggerInterface $logger;
50-
51-
public function __construct(private readonly AssetCollector $assetCollector) {}
49+
public function __construct(private readonly AssetCollector $assetCollector, private readonly LoggerInterface $logger) {}
5250

5351
/**
5452
* @throws NoSuchArgumentException|\JsonException
@@ -165,7 +163,8 @@ protected function initializeConnection($activeConnection): void
165163
$this->searchProvider = GeneralUtility::makeInstance(
166164
$connectionConfiguration['provider'],
167165
$activeConnection,
168-
$this->settings
166+
$this->settings,
167+
$this->logger,
169168
);
170169
$this->searchProvider->connect();
171170
}

Classes/Service/AbstractServiceProvider.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,16 @@
22

33
namespace Subugoe\Find\Service;
44

5-
use TYPO3\CMS\Core\Log\LogManager;
6-
use TYPO3\CMS\Core\Log\LogManagerInterface;
7-
use TYPO3\CMS\Core\Utility\GeneralUtility;
5+
use Psr\Log\LoggerInterface;
86

97
abstract class AbstractServiceProvider implements ServiceProviderInterface
108
{
11-
protected LogManagerInterface $logger;
12-
139
protected array $requestArguments = [];
1410

15-
public function __construct(protected string $connectionName, protected array $settings)
11+
public function __construct(protected string $connectionName, protected array $settings, protected LoggerInterface $logger)
1612
{
17-
$this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger('find');
1813
}
1914

20-
/**
21-
* @return array
22-
*/
2315
public function getRequestArguments(): array
2416
{
2517
return $this->requestArguments;

Classes/Service/ServiceProviderInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
*/
3333
interface ServiceProviderInterface
3434
{
35-
public function __construct(string $connectionName, array $settings);
36-
3735
public function connect();
3836

3937
public function getConfiguration();

0 commit comments

Comments
 (0)