Completed
Push — master ( e3b8a9...e92bf7 )
by huang
05:36
created

ErrorHandler::logContextFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
ccs 11
cts 11
cp 1
crap 1
1
<?php
2
/**
3
 * @author    jan huang <[email protected]>
4
 * @copyright 2016
5
 *
6
 * @see      https://www.github.com/janhuang
7
 * @see      http://www.fast-d.cn/
8
 */
9
10
namespace FastD\Logger;
11
12
/**
13
 * Class ErrorHandler.
14
 */
15
class ErrorHandler extends HandlerAbstract
16
{
17 1
    protected function logContextFormat()
18
    {
19
        return [
20 1
            'ip' => get_local_ip(),
21 1
            'status' => response()->getStatusCode(),
22 1
            'get' => request()->getQueryParams(),
23 1
            'post' => request()->getParsedBody(),
24 1
            'msg' => exception()->getMessage(),
25 1
            'code' => exception()->getCode(),
26 1
            'file' => exception()->getFile(),
27 1
            'line' => exception()->getLine(),
28 1
            'trace' => explode("\n", exception()->getTraceAsString()),
29 1
        ];
30
    }
31
}
32