Skip to content

Commit

Permalink
Remove irrelevant lines from backtrace
Browse files Browse the repository at this point in the history
  • Loading branch information
DieterHolvoet committed Feb 17, 2021
1 parent 0ffade2 commit 686506e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Logger/Sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Sentry\Serializer\Serializer;
use Sentry\Severity;
use Sentry\Stacktrace;
use Sentry\State\Hub;
use Sentry\State\Scope;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use function Sentry\addBreadcrumb;
Expand Down Expand Up @@ -217,12 +218,18 @@ protected function buildStacktrace(array $context): Stacktrace

$toIgnore = array_map(
function (string $className) use ($finder) {
if (file_exists($className)) {
return realpath($className);
}

return realpath($finder->findFile($className));
},
[
self::class,
\Drupal\Core\Logger\LoggerChannel::class,
\Psr\Log\LoggerTrait::class,
\Sentry\State\Hub::class,
DRUPAL_ROOT . '/../vendor/sentry/sentry/src/functions.php',
]
);

Expand Down

0 comments on commit 686506e

Please sign in to comment.