diff logger.inc @ 64:164268b4e0d9

Make class of logger.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Thu, 11 Oct 2012 20:33:04 +0200
parents 2cfea6e84694
children
line wrap: on
line diff
--- a/logger.inc	Thu Oct 11 20:26:27 2012 +0200
+++ b/logger.inc	Thu Oct 11 20:33:04 2012 +0200
@@ -3,17 +3,19 @@
  * @file
  * Common access point for logging
  */
-function logMsg($level, $msg)
-{
-  if (DEBUG_LEVEL >= $level) {
-    print $msg;
-    if(ABORT_ON_LOG)
-      exit;
+class Logger {
+  static function msg($level, $msg)
+  {
+    if (DEBUG_LEVEL >= $level) {
+      print $msg;
+      if(ABORT_ON_LOG)
+	exit;
+    }
+  }
+
+  static function warn($msg)
+  {
+    self::msg(VERBOSITY_WARNING, $msg);
   }
 }
-
-function warn($msg)
-{
-  logMsg(VERBOSITY_WARNING, $msg);
-}
 ?>
\ No newline at end of file