]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/jslib.js
Merge.
[irc/quakenet/qwebirc.git] / js / jslib.js
index 67a26ff1f7d5e534af81bd5950429d586bfa5a9f..52e3550023af49aa37f6ea23b1fae053de633c6b 100644 (file)
@@ -403,4 +403,23 @@ qwebirc.util.deviceHasKeyboard = function() {
 qwebirc.util.generateID_ID = 0;
 qwebirc.util.generateID = function() {
   return "qqa-" + qwebirc.util.generateID_ID++;
-}
\ No newline at end of file
+}
+
+qwebirc.util.__log = function(x) {
+  if(QWEBIRC_DEBUG) {
+    if(typeof console == "undefined") {
+      alert("log: " + x);
+    } else {
+      console.log(x);
+    }
+  }
+};
+
+qwebirc.util.logger = {
+  log: function(x) { qwebirc.util.__log("L " + x) },
+  info: function(x) { qwebirc.util.__log("I " + x) },
+  error: function(x) { qwebirc.util.__log("E " + x) },
+  warn: function(x) { qwebirc.util.__log("W " + x) }
+};
+
+qwebirc.util.log = qwebirc.util.logger.log;