[Libreoffice-commits] online.git: loleaflet/main.js loleaflet/src

László Németh laszlo.nemeth at collabora.com
Tue Mar 7 14:56:52 UTC 2017


 loleaflet/main.js            |    2 ++
 loleaflet/src/core/Socket.js |    6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 1b8b8f7efb268632106b1dea551391a4351f64d9
Author: László Németh <laszlo.nemeth at collabora.com>
Date:   Tue Mar 7 15:51:31 2017 +0100

    loleaflet: fix console log in tile debug mode
    
    Change-Id: Ic216369574b834148196d0ba8a03bc0a1d14db1a

diff --git a/loleaflet/main.js b/loleaflet/main.js
index c73e281..7822577 100644
--- a/loleaflet/main.js
+++ b/loleaflet/main.js
@@ -1,4 +1,6 @@
 // If not debug, don't print anything on the console
+// except in tile debug mode (Ctrl-Shift-Alt-d)
+console.log2 = console.log
 if (loleaflet_logging !== 'true') {
 	var methods = ['warn', 'info', 'debug', 'trace', 'log', 'assert', 'time', 'timeEnd'];
 	for (var i = 0; i < methods.length; i++) {
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 2bdf94c..477fb7b 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -85,7 +85,7 @@ L.Socket = L.Class.extend({
 			if (typeof msg === 'string') {
 				L.Log.log(msg, L.OUTGOING, coords);
 				if (this._map._docLayer && this._map._docLayer._debug) {
-					console.log(+new Date() + ' %cOUTGOING%c: ' + msg.concat(' ').replace(' ', '%c '), 'background:#fbb;color:black', 'color:red', 'color:black');
+					console.log2(+new Date() + ' %cOUTGOING%c: ' + msg.concat(' ').replace(' ', '%c '), 'background:#fbb;color:black', 'color:red', 'color:black');
 				}
 			}
 		}
@@ -100,7 +100,7 @@ L.Socket = L.Class.extend({
 		if (typeof msg === 'string') {
 			L.Log.log(msg, L.OUTGOING, coords);
 			if (this._map._docLayer && this._map._docLayer._debug) {
-				console.log(+new Date() + ' %cOUTGOING%c: ' + msg.concat(' ').replace(' ', '%c '), 'background:#fbb;color:black', 'color:red', 'color:black');
+				console.log2(+new Date() + ' %cOUTGOING%c: ' + msg.concat(' ').replace(' ', '%c '), 'background:#fbb;color:black', 'color:red', 'color:black');
 			}
 		}
 
@@ -164,7 +164,7 @@ L.Socket = L.Class.extend({
 		}
 
 		if (this._map._docLayer && this._map._docLayer._debug) {
-			console.log(+new Date() + ' %cINCOMING%c: ' + textMsg.concat(' ').replace(' ', '%c '), 'background:#ddf;color:black', 'color:blue', 'color:black');
+			console.log2(+new Date() + ' %cINCOMING%c: ' + textMsg.concat(' ').replace(' ', '%c '), 'background:#ddf;color:black', 'color:blue', 'color:black');
 		}
 
 		var command = this.parseServerCmd(textMsg);


More information about the Libreoffice-commits mailing list