| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function logException(Exception $ex) |
||
| 31 | { |
||
| 32 | $level = LogLevel::ALERT; |
||
| 33 | |||
| 34 | if ($ex instanceof ErrorException) { |
||
|
|
|||
| 35 | $level = LogLevel::ERROR; |
||
| 36 | } elseif ($ex instanceof RuntimeException) { |
||
| 37 | $level = LogLevel::EMERGENCY; |
||
| 38 | } |
||
| 39 | |||
| 40 | $this->logImpl($level, "({code}): {message}\n{stackTrace}", array( |
||
| 41 | 'code' => $ex->getCode(), |
||
| 42 | 'message' => $ex->getMessage(), |
||
| 43 | 'stackTrace' => $ex->getTraceAsString() |
||
| 44 | )); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |