EchoLogger   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A log() 0 7 2
1
<?php
2
3
namespace Arrilot\Logs;
4
5
use Psr\Log\AbstractLogger;
6
7
class EchoLogger extends AbstractLogger
8
{
9
    /**
10
     * Logs with an arbitrary level.
11
     *
12
     * @param mixed $level
13
     * @param string $message
14
     * @param array $context
15
     *
16
     * @return void
17
     */
18
    public function log($level, $message, array $context = array())
19
    {
20
        $dateTime = date('Y-m-d H:i:s');
21
        $newLine = php_sapi_name() === 'cli' ? "\r\n" : "<br>";
22
23
        echo "[{$dateTime}] {$level}: {$message}{$newLine}";
24
    }
25
}
26