summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2017-11-30 14:47:08 +0100
committerAlexander Larsson <alexl@redhat.com>2017-11-30 21:57:42 +0100
commitc30073793edcf373abf4fe31d6b51ec921bd2016 (patch)
tree7dfc3508c3cf48ea1be0e4058885b3eb9df8cbbe
parent521b09cc964346e1eb5c3c9241cc68bef42f860c (diff)
downloadgtk+-c30073793edcf373abf4fe31d6b51ec921bd2016.tar.gz
broadway: Improve logging
We now log backwards, so that the latest is always visible. Also, we use <pre> with a smaller size.
-rw-r--r--gdk/broadway/broadway.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index 5474960bc7..4e15ecd3ab 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -2,13 +2,14 @@
var logDiv = null;
function log(str) {
if (!logDiv) {
- logDiv = document.createElement('div');
+ logDiv = document.createElement('pre');
document.body.appendChild(logDiv);
logDiv.style["position"] = "absolute";
logDiv.style["right"] = "0px";
+ logDiv.style["font-size"] = "small";
}
- logDiv.appendChild(document.createTextNode(str));
- logDiv.appendChild(document.createElement('br'));
+ logDiv.insertBefore(document.createElement('br'), logDiv.firstChild);
+ logDiv.insertBefore(document.createTextNode(str), logDiv.firstChild);
}
function getStackTrace()