aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-05-12 13:13:19 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2017-05-12 13:13:19 +0200
commit0a033767db51d17439bfbd16bb0558327f1fc7a0 (patch)
tree778cd686b7f75b1341700139027eed52c4e2384b
parent06568b15bb9e9116fa4d4a42246e1b0e497bbf25 (diff)
downloadwallabag-0a033767db51d17439bfbd16bb0558327f1fc7a0.tar.gz
wallabag-0a033767db51d17439bfbd16bb0558327f1fc7a0.tar.zst
wallabag-0a033767db51d17439bfbd16bb0558327f1fc7a0.zip
Added logger when we match Tagging rules
-rw-r--r--src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php9
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
index b490e209..add27db2 100644
--- a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
+++ b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
@@ -8,6 +8,7 @@ use Wallabag\CoreBundle\Entity\Tag;
8use Wallabag\CoreBundle\Repository\EntryRepository; 8use Wallabag\CoreBundle\Repository\EntryRepository;
9use Wallabag\CoreBundle\Repository\TagRepository; 9use Wallabag\CoreBundle\Repository\TagRepository;
10use Wallabag\UserBundle\Entity\User; 10use Wallabag\UserBundle\Entity\User;
11use Psr\Log\LoggerInterface;
11 12
12class RuleBasedTagger 13class RuleBasedTagger
13{ 14{
@@ -15,11 +16,12 @@ class RuleBasedTagger
15 private $tagRepository; 16 private $tagRepository;
16 private $entryRepository; 17 private $entryRepository;
17 18
18 public function __construct(RulerZ $rulerz, TagRepository $tagRepository, EntryRepository $entryRepository) 19 public function __construct(RulerZ $rulerz, TagRepository $tagRepository, EntryRepository $entryRepository, LoggerInterface $logger)
19 { 20 {
20 $this->rulerz = $rulerz; 21 $this->rulerz = $rulerz;
21 $this->tagRepository = $tagRepository; 22 $this->tagRepository = $tagRepository;
22 $this->entryRepository = $entryRepository; 23 $this->entryRepository = $entryRepository;
24 $this->logger = $logger;
23 } 25 }
24 26
25 /** 27 /**
@@ -36,6 +38,11 @@ class RuleBasedTagger
36 continue; 38 continue;
37 } 39 }
38 40
41 $this->logger->info('Matching rule.', [
42 'rule' => $rule->getRule(),
43 'tags' => $rule->getTags(),
44 ]);
45
39 foreach ($rule->getTags() as $label) { 46 foreach ($rule->getTags() as $label) {
40 $tag = $this->getTag($label); 47 $tag = $this->getTag($label);
41 48
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 6c9195ce..a9134ac3 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -99,6 +99,7 @@ services:
99 - "@rulerz" 99 - "@rulerz"
100 - "@wallabag_core.tag_repository" 100 - "@wallabag_core.tag_repository"
101 - "@wallabag_core.entry_repository" 101 - "@wallabag_core.entry_repository"
102 - "@logger"
102 103
103 # repository as a service 104 # repository as a service
104 wallabag_core.entry_repository: 105 wallabag_core.entry_repository: