ConsoleLogger::log()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Ingenerator\RunSingle;
4
5
class ConsoleLogger extends \Psr\Log\AbstractLogger
6
{
7
    const DATE_FORMAT_INTL = 'Y-m-d\TH:i:se';
8
9
     /**
10
     * Logs with an arbitrary level.
11
     *
12
     * @param mixed $level
13
     * @param string $message
14
     * @param array $context
15
     * @return null
16
     */
17
    public function log($level, $message, array $context = array())
18
    {
19
        $time = new \DateTime;
20
        echo \sprintf(
21
            '%s: [%s] %s'.\PHP_EOL,
22
            $time->format('c'),
23
            $level,
24
            $message
25
        );
26
    }
27
28
}
29