[gtk+/broadway: 226/246] broadway: Add debug logging framework for js



commit c2ce462486d30fde74bf863454fd5307ee5a27e4
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Mar 14 10:05:24 2011 +0100

    broadway: Add debug logging framework for js

 gdk/broadway/broadway.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index 86649f4..da4b711 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -1,3 +1,16 @@
+/* Helper functions for debugging */
+var logDiv = null;
+function log(str) {
+    if (!logDiv) {
+	logDiv = document.createElement('div');
+	document.body.appendChild(logDiv);
+	logDiv.style["position"] = "absolute";
+	logDiv.style["right"] = "0px";
+    }
+    logDiv.appendChild(document.createTextNode(str));
+    logDiv.appendChild(document.createElement('br'));
+}
+
 var base64_val = [
   255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
   255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]