mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-08 06:06:40 +02:00
Merge pull request #608 from xploSEoF/patch-1
Ignore "call_user_func" from debug backtrace
This commit is contained in:
@@ -30,6 +30,11 @@ class IntrospectionProcessor
|
|||||||
|
|
||||||
private $skipClassesPartials;
|
private $skipClassesPartials;
|
||||||
|
|
||||||
|
private $skipFunctions = array(
|
||||||
|
'call_user_func',
|
||||||
|
'call_user_func_array',
|
||||||
|
);
|
||||||
|
|
||||||
public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array())
|
public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array())
|
||||||
{
|
{
|
||||||
$this->level = Logger::toMonologLevel($level);
|
$this->level = Logger::toMonologLevel($level);
|
||||||
@@ -56,15 +61,21 @@ class IntrospectionProcessor
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while (isset($trace[$i]['class'])) {
|
while (isset($trace[$i]['class']) || in_array($trace[$i]['function'], $this->skipFunctions)) {
|
||||||
foreach ($this->skipClassesPartials as $part) {
|
if(isset($trace[$i]['class'])) {
|
||||||
if (strpos($trace[$i]['class'], $part) !== false) {
|
foreach ($this->skipClassesPartials as $part) {
|
||||||
$i++;
|
if (strpos($trace[$i]['class'], $part) !== false) {
|
||||||
continue 2;
|
$i++;
|
||||||
}
|
continue 2;
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
}
|
} elseif(in_array($trace[$i]['function'], $this->skipFunctions)) {
|
||||||
|
$i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// we should have the call source now
|
// we should have the call source now
|
||||||
$record['extra'] = array_merge(
|
$record['extra'] = array_merge(
|
||||||
|
Reference in New Issue
Block a user