1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-10 15:14:14 +02:00

Added a TagProcessor

The TagProcessor adds the tags key to the record making it so that it can be used by handlers like Raven.
This commit is contained in:
ipsq
2014-03-31 20:15:58 +02:00
parent 4cf49e5496
commit c7ca9f7e5d

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Processor;
/**
* Adds a tags array into record
*
* @author Martijn Riemers
*/
class TagProcessor
{
private $tags;
public function __construct(array $tags = array())
{
$this->tags = $tags;
}
public function __invoke(array $record)
{
$record['tags'] = array_merge(
$this->tags,
$record['tags']
);
return $record;
}
}