From 328d66f13fc62018192a7d38281e6bbc09f5b798 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 13 Jul 2015 11:06:01 +0100 Subject: [PATCH] Fix support for associative tag arrays, refs #588 --- src/Monolog/Processor/TagProcessor.php | 2 +- tests/Monolog/Processor/TagProcessorTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Monolog/Processor/TagProcessor.php b/src/Monolog/Processor/TagProcessor.php index 2b6212e2..7e2df2ac 100644 --- a/src/Monolog/Processor/TagProcessor.php +++ b/src/Monolog/Processor/TagProcessor.php @@ -27,7 +27,7 @@ class TagProcessor public function addTags(array $tags = array()) { - $this->tags = array_values(array_unique(array_merge($this->tags, $tags))); + $this->tags = array_merge($this->tags, $tags); } public function setTags(array $tags = array()) diff --git a/tests/Monolog/Processor/TagProcessorTest.php b/tests/Monolog/Processor/TagProcessorTest.php index bf1659c5..0d860c61 100644 --- a/tests/Monolog/Processor/TagProcessorTest.php +++ b/tests/Monolog/Processor/TagProcessorTest.php @@ -42,8 +42,8 @@ class TagProcessorTest extends TestCase $record = $processor($this->getRecord()); $this->assertEquals(array('a', 'b'), $record['extra']['tags']); - $processor->addTags(array('a', 'c')); + $processor->addTags(array('a', 'c', 'foo' => 'bar')); $record = $processor($this->getRecord()); - $this->assertEquals(array('a', 'b', 'c'), $record['extra']['tags']); + $this->assertEquals(array('a', 'b', 'a', 'c', 'foo' => 'bar'), $record['extra']['tags']); } }