@@ -155,6 +155,14 @@ public static function debug($s, $o = null) {
155
155
self ::instance ()->logDebug ($ s , $ o );
156
156
}
157
157
158
+ /**
159
+ * Return whether debug level will be logged.
160
+ * @return TRUE when log level enabled.
161
+ */
162
+ public static function isDebug () {
163
+ return self ::instance ()->isLogLevelIncluded (self ::DEBUG );
164
+ }
165
+
158
166
/**
159
167
* Debug message into log.
160
168
* @param string $s - the message
@@ -173,6 +181,14 @@ public static function info($s, $o = null) {
173
181
self ::instance ()->logInfo ($ s , $ o );
174
182
}
175
183
184
+ /**
185
+ * Return whether info level will be logged.
186
+ * @return TRUE when log level enabled.
187
+ */
188
+ public static function isInfo () {
189
+ return self ::instance ()->isLogLevelIncluded (self ::INFO );
190
+ }
191
+
176
192
/**
177
193
* Info message into log.
178
194
* @param string $s - the message
@@ -191,6 +207,14 @@ public static function warn($s, $o = null) {
191
207
self ::instance ()->logWarn ($ s , $ o );
192
208
}
193
209
210
+ /**
211
+ * Return whether warn level will be logged.
212
+ * @return TRUE when log level enabled.
213
+ */
214
+ public static function isWarn () {
215
+ return self ::instance ()->isLogLevelIncluded (self ::WARN );
216
+ }
217
+
194
218
/**
195
219
* Warning message into log.
196
220
* @param string $s - the message
@@ -209,6 +233,14 @@ public static function error($s, $o = null) {
209
233
self ::instance ()->logError ($ s , $ o );
210
234
}
211
235
236
+ /**
237
+ * Return whether error level will be logged.
238
+ * @return TRUE when log level enabled.
239
+ */
240
+ public static function isError () {
241
+ return self ::instance ()->isLogLevelIncluded (self ::ERROR );
242
+ }
243
+
212
244
/**
213
245
* Error message into log.
214
246
* @param string $s - the message
@@ -295,7 +327,7 @@ public static function clean() {
295
327
public static function get () {
296
328
return $ _SESSION ['messages ' ];
297
329
}
298
-
330
+
299
331
/**
300
332
* Internal function to check whether a loglevel is supposed to be logged.
301
333
* @param string $sev - the log level to check
0 commit comments