12
12
*/
13
13
class Log {
14
14
15
- public static const NONE = 'none ' ;
16
- public static const DEBUG = 'debug ' ;
17
- public static const INFO = 'info ' ;
18
- public static const WARN = 'warn ' ;
19
- public static const ERROR = 'error ' ;
15
+ public const NONE = 'none ' ;
16
+ public const DEBUG = 'debug ' ;
17
+ public const INFO = 'info ' ;
18
+ public const WARN = 'warn ' ;
19
+ public const ERROR = 'error ' ;
20
20
21
21
/** The available log priorities */
22
22
protected static $ logPriorities ;
@@ -35,7 +35,7 @@ class Log {
35
35
*/
36
36
public static function instance () {
37
37
if (self ::$ logLevel == null ) {
38
- self ::$ logLevel == INFO ;
38
+ self ::$ logLevel == self :: INFO ;
39
39
}
40
40
if (self ::$ instance == null ) {
41
41
self ::$ instance = new Log ();
@@ -109,7 +109,7 @@ public function getStackTrace($excludeFile = NULL) {
109
109
* @param mixed $o - an oject to be dumped along with message. An Exception object will cause a stacktrace dump (optional).
110
110
*/
111
111
public static function debug ($ s , $ o = null ) {
112
- self ::instance ()->log (DEBUG , $ s , $ o );
112
+ self ::instance ()->log (self :: DEBUG , $ s , $ o );
113
113
}
114
114
115
115
/**
@@ -118,7 +118,7 @@ public static function debug($s, $o = null) {
118
118
* @param mixed $o - an oject to be dumped along with message. An Exception object will cause a stacktrace dump (optional).
119
119
*/
120
120
public static function info ($ s , $ o = null ) {
121
- self ::instance ()->log (INFO , $ s , $ o );
121
+ self ::instance ()->log (self :: INFO , $ s , $ o );
122
122
}
123
123
124
124
/**
@@ -127,7 +127,7 @@ public static function info($s, $o = null) {
127
127
* @param mixed $o - an oject to be dumped along with message. An Exception object will cause a stacktrace dump (optional).
128
128
*/
129
129
public static function warn ($ s , $ o = null ) {
130
- self ::instance ()->log (WARN , $ s , $ o );
130
+ self ::instance ()->log (self :: WARN , $ s , $ o );
131
131
}
132
132
133
133
/**
@@ -136,39 +136,39 @@ public static function warn($s, $o = null) {
136
136
* @param mixed $o - an oject to be dumped along with message. An Exception object will cause a stacktrace dump (optional).
137
137
*/
138
138
public static function error ($ s , $ o = null ) {
139
- self ::instance ()->log (ERROR , $ s , $ o );
139
+ self ::instance ()->log (self :: ERROR , $ s , $ o );
140
140
}
141
141
142
142
/**
143
143
* Print stacktrace into debug log, optionally excluding a certain file from trace.
144
144
* @param string $excludeFile - the file to be excluded (optional).
145
145
*/
146
146
public static function debugStackTrace ($ excludeFile = NULL ) {
147
- self ::instance ()->logStackTrace (DEBUG , $ excludeFile );
147
+ self ::instance ()->logStackTrace (self :: DEBUG , $ excludeFile );
148
148
}
149
149
150
150
/**
151
151
* Print stacktrace into info log, optionally excluding a certain file from trace.
152
152
* @param string $excludeFile - the file to be excluded (optional).
153
153
*/
154
154
public static function infoStackTrace ($ excludeFile = NULL ) {
155
- self ::instance ()->logStackTrace (INFO , $ excludeFile );
155
+ self ::instance ()->logStackTrace (self :: INFO , $ excludeFile );
156
156
}
157
157
158
158
/**
159
159
* Print stacktrace into warning log, optionally excluding a certain file from trace.
160
160
* @param string $excludeFile - the file to be excluded (optional).
161
161
*/
162
162
public static function warnStackTrace ($ excludeFile = NULL ) {
163
- self ::instance ()->logStackTrace (WARN , $ excludeFile );
163
+ self ::instance ()->logStackTrace (self :: WARN , $ excludeFile );
164
164
}
165
165
166
166
/**
167
167
* Print stacktrace into error log, optionally excluding a certain file from trace.
168
168
* @param string $excludeFile - the file to be excluded (optional).
169
169
*/
170
170
public static function errorStackTrace ($ excludeFile = NULL ) {
171
- self ::instance ()->logStackTrace (ERROR , $ excludeFile );
171
+ self ::instance ()->logStackTrace (self :: ERROR , $ excludeFile );
172
172
}
173
173
174
174
/**
@@ -216,7 +216,7 @@ public static function get() {
216
216
*/
217
217
protected static function isLogLevelIncluded ($ sev ) {
218
218
if (self ::$ logPriorities == null ) {
219
- self ::$ logPriorities = array (NONE , DEBUG , INFO , WARN , ERROR );
219
+ self ::$ logPriorities = array (self :: NONE , self :: DEBUG , self :: INFO , self :: WARN , self :: ERROR );
220
220
}
221
221
$ logIndex = array_search (self ::$ logLevel , self ::$ logPriorities );
222
222
$ sevIndex = array_search ($ sev , self ::$ logPriorities );
0 commit comments