Failed Conditions
Pull Request — master (#1873)
by Tsuyoshi
273:59 queued 266:59
created

Log   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
dl 0
loc 98
rs 10
c 0
b 0
f 0
ccs 9
cts 27
cp 0.3333
wmc 9
lcom 0
cbo 1

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setLogger() 0 4 1
A emergency() 0 4 1
A alert() 0 4 1
A critical() 0 4 1
A error() 0 4 1
A warning() 0 4 1
A notice() 0 4 1
A info() 0 4 1
A debug() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.co.jp/
9
 *
10
 * This program is free software; you can redistribute it and/or
11
 * modify it under the terms of the GNU General Public License
12
 * as published by the Free Software Foundation; either version 2
13
 * of the License, or (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program; if not, write to the Free Software
22
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23
 */
24
25
namespace Eccube\Log;
26
27
use Psr\Log\LoggerAwareInterface;
28
use Psr\Log\LoggerInterface;
29
30
/**
31
 * EC-CUBE専用ログ出力クラス
32
 * namespaceは設定せず、各プログラムからはクラス名::関数名(\EccubeLog::info())で利用できるようにしている。
33
 * ログ出力時はレベルに応じた関数を使用する。
34
 *
35
 * ログ出力は実際にはLoggerクラスで行っている。
36
 */
37
class Log implements LoggerAwareInterface
38
{
39
    protected $logger;
40
41 1062
    public function setLogger(LoggerInterface $logger)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
42
    {
43 1062
        $this->logger = $logger;
44 1062
    }
45
46
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$message" missing
Loading history...
47
     * emergencyレベル用
48
     *
49
     * @param $message
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
50
     * @param array $context
0 ignored issues
show
introduced by
Expected 3 spaces after parameter type; 1 found
Loading history...
51
     */
52
    public function emergency($message, array $context = array())
53
    {
54
        $this->logger->emergency($message, $context);
55
    }
56
57
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$message" missing
Loading history...
58
     * alertレベル用
59
     *
60
     * @param $message
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
61
     * @param array $context
0 ignored issues
show
introduced by
Expected 3 spaces after parameter type; 1 found
Loading history...
62
     */
63
    public function alert($message, array $context = array())
64
    {
65
        $this->logger->alert($message, $context);
66
    }
67
68
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$message" missing
Loading history...
69
     * criticalレベル用
70
     *
71
     * @param $message
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
72
     * @param array $context
0 ignored issues
show
introduced by
Expected 3 spaces after parameter type; 1 found
Loading history...
73
     */
74
    public function critical($message, array $context = array())
75
    {
76
        $this->logger->critical($message, $context);
77
    }
78
79
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$message" missing
Loading history...
80
     * errorレベル用
81
     *
82
     * @param $message
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
83
     * @param array $context
0 ignored issues
show
introduced by
Expected 3 spaces after parameter type; 1 found
Loading history...
84
     */
85 4
    public function error($message, array $context = array())
86
    {
87 4
        $this->logger->error($message, $context);
88 4
    }
89
90
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$message" missing
Loading history...
91
     * warningレベル用
92
     *
93
     * @param $message
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
94
     * @param array $context
0 ignored issues
show
introduced by
Expected 3 spaces after parameter type; 1 found
Loading history...
95
     */
96
    public function warning($message, array $context = array())
97
    {
98
        $this->logger->warning($message, $context);
99
    }
100
101
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$message" missing
Loading history...
102
     * noticeレベル用
103
     *
104
     * @param $message
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
105
     * @param array $context
0 ignored issues
show
introduced by
Expected 3 spaces after parameter type; 1 found
Loading history...
106
     */
107
    public function notice($message, array $context = array())
108
    {
109
        $this->logger->notice($message, $context);
110
    }
111
112
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$message" missing
Loading history...
113
     * infoレベル用
114
     *
115
     * @param $message
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
116
     * @param array $context
0 ignored issues
show
introduced by
Expected 3 spaces after parameter type; 1 found
Loading history...
117
     */
118 463
    public function info($message, array $context = array())
119
    {
120 463
        $this->logger->info($message, $context);
121 463
    }
122
123
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$message" missing
Loading history...
124
     * debugレベル用
125
     *
126
     * @param $message
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
127
     * @param array $context
0 ignored issues
show
introduced by
Expected 3 spaces after parameter type; 1 found
Loading history...
128
     */
129
    public function debug($message, array $context = array())
130
    {
131
        $this->logger->debug($message, $context);
132
    }
133
134
}
135