Completed
Push — master ( 9b3fe3...b82616 )
by Hong
06:10 queued 03:55
created

SystemLog::getProcessors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Phoole (PHP7.2+)
5
 *
6
 * @category  Library
7
 * @package   Phoole\Logger
8
 * @copyright Copyright (c) 2019 Hong Zhang
9
 */
10
declare(strict_types=1);
11
12
namespace Phoole\Logger\Entry;
13
14
use Phoole\Logger\Processor\MemoryProcessor;
15
16
/**
17
 * Log system related message.
18
 *
19
 * ```php
20
 * $log = new Logger('MyApp');
21
 *
22
 * $log->addHandler(
23
 *     new LogfileHandler('system.log'),
24
 *     LogLevel::INFO,
25
 *     SystemLog::class
26
 * );
27
 *
28
 * $log->info(new SystemLog());
29
 * ```
30
 *
31
 * @package Phoole\Logger
32
 */
33
class SystemLog extends LogEntry
34
{
35
    /**
36
     * default message template
37
     * @var string
38
     */
39
    protected $message = '{memory_used}M memory used, peak usage is {memory_peak}M';
40
41
    /**
42
     * {@inheritDoc}
43
     */
44
    public function getProcessors(): array
45
    {
46
        return array_merge(parent::getProcessors(), [
47
            MemoryProcessor::class
48
        ]);
49
    }
50
}
51