1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-31 18:30:15 +02:00

Make IntrospectionProcessor extendable (#1899)

This commit is contained in:
Luboš Hubáček
2024-08-27 09:51:08 +02:00
committed by GitHub
parent 5c41cf7a24
commit 3327c29d37

View File

@@ -29,18 +29,22 @@ use Monolog\LogRecord;
*/
class IntrospectionProcessor implements ProcessorInterface
{
private Level $level;
protected Level $level;
/** @var string[] */
private array $skipClassesPartials;
protected array $skipClassesPartials;
private int $skipStackFramesCount;
protected int $skipStackFramesCount;
private const SKIP_FUNCTIONS = [
protected const SKIP_FUNCTIONS = [
'call_user_func',
'call_user_func_array',
];
protected const SKIP_CLASSES = [
'Monolog\\',
];
/**
* @param string|int|Level $level The minimum logging level at which this Processor will be triggered
* @param string[] $skipClassesPartials
@@ -50,7 +54,7 @@ class IntrospectionProcessor implements ProcessorInterface
public function __construct(int|string|Level $level = Level::Debug, array $skipClassesPartials = [], int $skipStackFramesCount = 0)
{
$this->level = Logger::toMonologLevel($level);
$this->skipClassesPartials = array_merge(['Monolog\\'], $skipClassesPartials);
$this->skipClassesPartials = array_merge(static::SKIP_CLASSES, $skipClassesPartials);
$this->skipStackFramesCount = $skipStackFramesCount;
}