Skip to content

Commit 6dd9928

Browse files
committed
TASK: Use psr loggerinterface instead of the removed system logger interface
1 parent 06885e8 commit 6dd9928

4 files changed

Lines changed: 17 additions & 14 deletions

File tree

Classes/Hooks/ContentRepositoryHooks.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
use Neos\Error\Messages\Message;
55
use Neos\Flow\Annotations as Flow;
66
use Neos\ContentRepository\Domain\Model\NodeInterface;
7-
use Neos\Flow\Log\SystemLoggerInterface;
87
use Sitegeist\Taxonomy\Service\TaxonomyService;
98
use Sitegeist\Taxonomy\Service\DimensionService;
9+
use Psr\Log\LoggerInterface;
1010

1111
/**
1212
* Class ContentRepositoryHooks
@@ -17,10 +17,10 @@ class ContentRepositoryHooks
1717
{
1818

1919
/**
20-
* @var SystemLoggerInterface
20+
* @var LoggerInterface
2121
* @Flow\Inject
2222
*/
23-
protected $systemLogger;
23+
protected $logger;
2424

2525
/**
2626
* @var TaxonomyService
@@ -46,7 +46,7 @@ class ContentRepositoryHooks
4646
*/
4747
public function nodeAdded(NodeInterface $node)
4848
{
49-
$this->systemLogger->log(new Message(sprintf("CREATED NODE %S", $node->getContextPath())));
49+
$this->logger->info(sprintf("CREATED NODE %S", $node->getContextPath()));
5050

5151
if ($node->getNodeType()->isOfType($this->taxonomyService->getRootNodeType()) ||
5252
$node->getNodeType()->isOfType($this->taxonomyService->getVocabularyNodeType()) ||
@@ -66,7 +66,7 @@ public function nodeAdded(NodeInterface $node)
6666
*/
6767
public function nodeRemoved(NodeInterface $node)
6868
{
69-
$this->systemLogger->log(new Message(sprintf("CREATED NODE %S", $node->getContextPath())));
69+
$this->logger->info(sprintf("CREATED NODE %S", $node->getContextPath()));
7070

7171
if ($node->getNodeType()->isOfType($this->taxonomyService->getRootNodeType()) ||
7272
$node->getNodeType()->isOfType($this->taxonomyService->getVocabularyNodeType()) ||

Classes/Service/TaxonomyService.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Neos\ContentRepository\Domain\Service\NodeTypeManager;
1313
use Neos\ContentRepository\Domain\Repository\NodeDataRepository;
1414
use Neos\Flow\Persistence\PersistenceManagerInterface;
15-
use Neos\Flow\Log\SystemLoggerInterface;
1615

1716
/**
1817
* Class TaxonomyService
@@ -22,12 +21,6 @@
2221
class TaxonomyService
2322
{
2423

25-
/**
26-
* @var SystemLoggerInterface
27-
* @Flow\Inject
28-
*/
29-
protected $systemLogger;
30-
3124
/**
3225
* @Flow\Inject
3326
* @var NodeDataRepository

Configuration/Objects.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
Sitegeist\Taxonomy\Hooks\ContentRepositoryHooks:
3+
properties:
4+
logger:
5+
object:
6+
factoryObjectName: Neos\Flow\Log\PsrLoggerFactoryInterface
7+
factoryMethodName: get
8+
arguments:
9+
1:
10+
value: systemLogger

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"name": "sitegeist/taxonomy",
55
"license": "GPL-3.0+",
66
"require": {
7-
"neos/neos": "*",
8-
"neos/neos-ui": "^2.1 || ^3.1 || ^4.0 || ^5.0 || dev-master",
7+
"neos/neos": "^4.3 || ^5.0 || dev-master",
8+
"neos/neos-ui": "^4.0 || ^5.0 || dev-master",
99
"neos/content-repository": "*"
1010
},
1111
"suggest": {

0 commit comments

Comments
 (0)