Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
16 | public function logException($context, \Exception $e) |
||
17 | { |
||
18 | if (true === version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '9.5.0', '<')) { |
||
19 | $this->syslog( |
||
20 | $context, |
||
21 | 'Exception occured ' . PHP_EOL . |
||
22 | ' Code: ' . $e->getCode() . PHP_EOL . |
||
23 | ' Message: "' . $e->getMessage() . '"' . PHP_EOL . |
||
24 | ' Trace:' . PHP_EOL . $e->getTraceAsString(), |
||
25 | 4 |
||
26 | ); |
||
27 | return; |
||
28 | } |
||
29 | |||
30 | $this->logger = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class)->getLogger(__CLASS__); |
||
31 | $this->logger->error( |
||
32 | $context . ': ' . $e->getMessage(), |
||
33 | $e->getTrace() |
||
34 | ); |
||
45 | } |