Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | trait LogTrait |
||
6 | { |
||
7 | public function logException(\Exception $e) |
||
8 | { |
||
9 | $this->log( |
||
10 | sprintf( |
||
11 | 'Uncaught exception \'%s\': [%d]%s called in %s:%d%s%s', |
||
12 | get_class($e), |
||
13 | $e->getCode(), |
||
14 | $e->getMessage(), |
||
15 | $e->getFile(), |
||
16 | $e->getLine(), |
||
17 | PHP_EOL, |
||
18 | $e->getTraceAsString() |
||
19 | ), |
||
20 | 'ERROR' |
||
21 | ); |
||
22 | } |
||
23 | |||
24 | public function log($msg, $type = 'INFO') |
||
27 | } |
||
28 | |||
29 | public function callWithCatchException(callable $callback) |
||
38 | } |