mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-21 21:36:11 +01:00
TASK: Provide already used logger
As we use the logger, we should inject it.
This commit is contained in:
parent
9e80574361
commit
6d7199ccf2
2 changed files with 16 additions and 0 deletions
|
@ -37,6 +37,21 @@ class IndexFactory implements Singleton
|
|||
*/
|
||||
protected $configuration;
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Core\Log\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* Inject log manager to get concrete logger from it.
|
||||
*
|
||||
* @param \TYPO3\CMS\Core\Log\LogManager $logManager
|
||||
*/
|
||||
public function injectLogger(\TYPO3\CMS\Core\Log\LogManager $logManager)
|
||||
{
|
||||
$this->logger = $logManager->getLogger(__CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ConfigurationContainerInterface $configuration
|
||||
*/
|
||||
|
|
|
@ -38,6 +38,7 @@ class IndexFactoryTest extends AbstractUnitTestCase
|
|||
|
||||
$this->configuration = $this->getMockBuilder(ConfigurationContainerInterface::class)->getMock();
|
||||
$this->subject = new IndexFactory($this->configuration);
|
||||
$this->subject->injectLogger($this->getMockedLogger());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue