From 772b0c61994741f5dd8f7efbafefdd986e898b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Hub=C3=A1=C4=8Dek?= Date: Sun, 21 Jul 2024 16:20:34 +0200 Subject: [PATCH] Make IntrospectionProcessor extendable --- src/Monolog/Processor/IntrospectionProcessor.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Monolog/Processor/IntrospectionProcessor.php b/src/Monolog/Processor/IntrospectionProcessor.php index efc2f50aa..b942dc055 100644 --- a/src/Monolog/Processor/IntrospectionProcessor.php +++ b/src/Monolog/Processor/IntrospectionProcessor.php @@ -29,18 +29,22 @@ */ 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; }