comparison Logger.inc.php @ 134:b6b4a58c7625

Using .inc.php rather than just .inc for include files.
author Tom Fredrik Blenning <bfg@bfgconsult.no>
date Sun, 22 Jan 2023 19:22:00 +0100
parents Logger.inc@74f7b64bdb78
children
comparison
equal deleted inserted replaced
133:00255ca89459 134:b6b4a58c7625
1 <?php
2 /**
3 * Common access point for logging
4 */
5 class Logger {
6 /**
7 * All logging goes through this function
8 *
9 * @param $level the severity level of this message
10 * @param $msg message to be logged
11 */
12 static function msg($level, $msg)
13 {
14 if (DEBUG_LEVEL >= $level) {
15 print $msg;
16 if(ABORT_ON_LOG)
17 exit;
18 }
19 }
20
21 /**
22 * Convenience function, logs a message with level VERBOSITY_WARNING
23 *
24 * @param $msg message to be logged
25 */
26 static function warn($msg)
27 {
28 self::msg(VERBOSITY_WARNING, $msg);
29 }
30 }
31 ?>