Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make IntrospectionProcessor extendable #1899

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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