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

HandlerAbstract   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1
wmc 1
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 6 1
logContextFormat() 0 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
use Monolog\Handler\StreamHandler;
13
14
abstract class HandlerAbstract extends StreamHandler
15
{
16
    /**
17
     * Writes the record down to the log of the implementing handler.
18
     *
19
     * @param array $record
20
     */
21 2
    protected function write(array $record = [])
22
    {
23 2
        $record['context'] = $this->logContextFormat();
24
25 2
        parent::write($record);
26 2
    }
27
28
    /**
29
     * @return array
30
     */
31
    abstract protected function logContextFormat();
32
}
33