HandlerAbstract   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
logContextFormat() 0 1 ?
A write() 0 6 1
1
<?php
2
/**
3
 * @author    jan huang <[email protected]>
4
 * @copyright 2016
5
 *
6
 * @see      https://www.github.com/janhuang
7
 * @see      https://fastdlabs.com
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
    protected function write(array $record = [])
22
    {
23
        $record['context'] = $this->logContextFormat();
24
25
        parent::write($record);
26
    }
27
28
    /**
29
     * @return array
30
     */
31
    abstract protected function logContextFormat();
32
}
33