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