Skip to content

Commit

Permalink
Make IntrospectionProcessor extendable (#1899)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sekiphp committed Aug 27, 2024
1 parent 5c41cf7 commit 3327c29
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Monolog/Processor/IntrospectionProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down

0 comments on commit 3327c29

Please sign in to comment.