mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 21:26:43 +02:00
Multiple functions to skip
Add an array for holding the functions to skip, preventing the functions from ever being used for introspection
This commit is contained in:
@@ -29,6 +29,11 @@ class IntrospectionProcessor
|
||||
private $level;
|
||||
|
||||
private $skipClassesPartials;
|
||||
|
||||
private $skipFunctions = array(
|
||||
'call_user_func',
|
||||
'call_user_func_array',
|
||||
);
|
||||
|
||||
public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array('Monolog\\'))
|
||||
{
|
||||
@@ -56,7 +61,7 @@ class IntrospectionProcessor
|
||||
|
||||
$i = 0;
|
||||
|
||||
while (isset($trace[$i]['class']) || $trace[$i]['function'] == 'call_user_func') {
|
||||
while (isset($trace[$i]['class']) || in_array($trace[$i]['function'], $this->skipFunctions)) {
|
||||
if(isset($trace[$i]['class'])) {
|
||||
foreach ($this->skipClassesPartials as $part) {
|
||||
if (strpos($trace[$i]['class'], $part) !== false) {
|
||||
@@ -64,7 +69,7 @@ class IntrospectionProcessor
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
} elseif($trace[$i]['function'] == 'call_user_func') {
|
||||
} elseif(in_array($trace[$i]['function'], $this->skipFunctions)) {
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user