Skip to content

Commit 1a8c622

Browse files
committed
Releasing 1.1.12
2 parents 543c9e0 + be85ed5 commit 1a8c622

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

src/TgLog/Log.php

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ public static function debug($s, $o = null) {
155155
self::instance()->logDebug($s, $o);
156156
}
157157

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+
158166
/**
159167
* Debug message into log.
160168
* @param string $s - the message
@@ -173,6 +181,14 @@ public static function info($s, $o = null) {
173181
self::instance()->logInfo($s, $o);
174182
}
175183

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+
176192
/**
177193
* Info message into log.
178194
* @param string $s - the message
@@ -191,6 +207,14 @@ public static function warn($s, $o = null) {
191207
self::instance()->logWarn($s, $o);
192208
}
193209

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+
194218
/**
195219
* Warning message into log.
196220
* @param string $s - the message
@@ -209,6 +233,14 @@ public static function error($s, $o = null) {
209233
self::instance()->logError($s, $o);
210234
}
211235

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+
212244
/**
213245
* Error message into log.
214246
* @param string $s - the message
@@ -295,7 +327,7 @@ public static function clean() {
295327
public static function get() {
296328
return $_SESSION['messages'];
297329
}
298-
330+
299331
/**
300332
* Internal function to check whether a loglevel is supposed to be logged.
301333
* @param string $sev - the log level to check

0 commit comments

Comments
 (0)