Logger::getLogger()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
1
<?php
2
3
namespace cvweiss\projectbase;
4
5
use \Monolog\Logger as MonoLogger;
6
use \Monolog\Handler\StreamHandler;
7
8
class Logger
9
{
10
    private static $logger;
11
12
    protected static function getLogger()
13
    {
14
        if (self::$logger == null)
15
        {
16
            self::$logger = new MonoLogger('projectbase');
17
            self::$logger->pushHandler(new MongoLogger());
18
        }
19
        return self::$logger;
20
    }
21
22
    public static function debug($string)
23
    {
24
        return self::getLogger()->debug($string);
25
    }
26
27
    public static function info($string)
28
    {
29
        return self::getLogger()->info($string);
30
    }
31
32
    public static function notice($string)
33
    {
34
        return self::getLogger()->notice($string);
35
    }
36
}
37