1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-04 20:27:31 +02:00

Add ProcessorInterface, an optional one to allow labelling Monolog processors

This commit is contained in:
Nicolas Grekas
2018-10-12 11:59:23 -07:00
parent c465e11445
commit db8130ce83
10 changed files with 34 additions and 9 deletions

View File

@@ -19,7 +19,7 @@ use Monolog\Logger;
* @author Nick Otter * @author Nick Otter
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class GitProcessor class GitProcessor implements ProcessorInterface
{ {
private $level; private $level;
private static $cache; private static $cache;

View File

@@ -24,7 +24,7 @@ use Monolog\Logger;
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class IntrospectionProcessor class IntrospectionProcessor implements ProcessorInterface
{ {
private $level; private $level;

View File

@@ -16,7 +16,7 @@ namespace Monolog\Processor;
* *
* @author Rob Jensen * @author Rob Jensen
*/ */
abstract class MemoryProcessor abstract class MemoryProcessor implements ProcessorInterface
{ {
/** /**
* @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported. * @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.

View File

@@ -18,7 +18,7 @@ use Monolog\Logger;
* *
* @author Jonathan A. Schweder <jonathanschweder@gmail.com> * @author Jonathan A. Schweder <jonathanschweder@gmail.com>
*/ */
class MercurialProcessor class MercurialProcessor implements ProcessorInterface
{ {
private $level; private $level;
private static $cache; private static $cache;

View File

@@ -16,7 +16,7 @@ namespace Monolog\Processor;
* *
* @author Andreas Hörnicke * @author Andreas Hörnicke
*/ */
class ProcessIdProcessor class ProcessIdProcessor implements ProcessorInterface
{ {
/** /**
* @param array $record * @param array $record

View File

@@ -0,0 +1,25 @@
<?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;
/**
* An optional interface to allow labelling Monolog processors.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
interface ProcessorInterface
{
/**
* @return array The processed records
*/
public function __invoke(array $records);
}

View File

@@ -18,7 +18,7 @@ namespace Monolog\Processor;
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class PsrLogMessageProcessor class PsrLogMessageProcessor implements ProcessorInterface
{ {
/** /**
* @param array $record * @param array $record

View File

@@ -16,7 +16,7 @@ namespace Monolog\Processor;
* *
* @author Martijn Riemers * @author Martijn Riemers
*/ */
class TagProcessor class TagProcessor implements ProcessorInterface
{ {
private $tags; private $tags;

View File

@@ -16,7 +16,7 @@ namespace Monolog\Processor;
* *
* @author Simon Mönch <sm@webfactory.de> * @author Simon Mönch <sm@webfactory.de>
*/ */
class UidProcessor class UidProcessor implements ProcessorInterface
{ {
private $uid; private $uid;

View File

@@ -16,7 +16,7 @@ namespace Monolog\Processor;
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class WebProcessor class WebProcessor implements ProcessorInterface
{ {
/** /**
* @var array|\ArrayAccess * @var array|\ArrayAccess