HandlerAbstract::logContextFormat()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 1
c 0
b 0
f 0
ccs 0
cts 0
cp 0
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