mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-02 19:27:37 +02:00
Remove closure stack frames entirely from log
This commit is contained in:
@@ -195,8 +195,6 @@ class JsonFormatter extends NormalizerFormatter
|
|||||||
foreach ($trace as $frame) {
|
foreach ($trace as $frame) {
|
||||||
if (isset($frame['file'])) {
|
if (isset($frame['file'])) {
|
||||||
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
||||||
} else {
|
|
||||||
$data['trace'][] = (!empty($frame['class']) ? $frame['class'].$frame['type'] : '').$frame['function'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -151,8 +151,6 @@ class NormalizerFormatter implements FormatterInterface
|
|||||||
foreach ($trace as $frame) {
|
foreach ($trace as $frame) {
|
||||||
if (isset($frame['file'])) {
|
if (isset($frame['file'])) {
|
||||||
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
||||||
} else {
|
|
||||||
$data['trace'][] = (!empty($frame['class']) ? $frame['class'].$frame['type'] : '').$frame['function'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -391,11 +391,8 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$result = $formatter->format($record);
|
$result = $formatter->format($record);
|
||||||
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
array(
|
__FILE__.':'.(__LINE__-10),
|
||||||
PHP_VERSION_ID < 50400 ? 'Monolog\Formatter\{closure}' : 'Monolog\Formatter\NormalizerFormatterTest->Monolog\Formatter\{closure}',
|
$result['context']['exception']['trace'][0]
|
||||||
__FILE__.':'.(__LINE__-12),
|
|
||||||
),
|
|
||||||
array_slice($result['context']['exception']['trace'], 0, 2)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -412,7 +409,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$result = $formatter->format($record);
|
$result = $formatter->format($record);
|
||||||
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
'Monolog\\Formatter\\NormalizerFormatterTest->throwHelper',
|
__FILE__ .':'.(__LINE__-9),
|
||||||
$result['context']['exception']['trace'][0]
|
$result['context']['exception']['trace'][0]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -27,8 +27,6 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
foreach ($trace as $frame) {
|
foreach ($trace as $frame) {
|
||||||
if (isset($frame['file'])) {
|
if (isset($frame['file'])) {
|
||||||
$data[] = $frame['file'].':'.$frame['line'];
|
$data[] = $frame['file'].':'.$frame['line'];
|
||||||
} else {
|
|
||||||
$data[] = (!empty($frame['class']) ? $frame['class'].$frame['type'] : '').$frame['function'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user