loleaflet/src/core/Socket.js |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 2d52ddcb601bed514ed13ab9afdf89f8bc51aaac
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Fri Nov 15 18:09:24 2019 +0000
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Fri Nov 15 18:09:24 2019 +0000

    avoid spamming the JS console with load state messages.
    
    Instead highlight messages received when not fully initialized.
    
    Change-Id: I2ee2c9cf20ceaf3f98f1500add3f56256e65f42d

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index f391e4108..4ce83df03 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -234,7 +234,6 @@ L.Socket = L.Class.extend({
        },
 
        _logSocket: function(type, msg) {
-
                var fullDebug = this._map._docLayer && 
this._map._docLayer._debug;
                if (!window.protocolDebug && !fullDebug)
                        return;
@@ -242,15 +241,20 @@ L.Socket = L.Class.extend({
                if (!fullDebug && msg.length > 256) // for reasonable 
performance.
                        msg = msg.substring(0,256) + '<truncated ' + 
(msg.length - 256) + 'chars>';
 
+               var status = '';
+               if (!window.fullyLoadedAndReady)
+                       status += '[!fullyLoadedAndReady]';
+               if (!window.bundlejsLoaded)
+                       status += '[!bundlejsLoaded]';
+
                var color = type === 'OUTGOING' ? 'color:red' : 'color:blue';
-               console.log2(+new Date() + ' %c' + type + '%c: ' + msg.concat(' 
').replace(' ', '%c '),
+               console.log2(+new Date() + ' %c' + type + status + '%c: ' + 
msg.concat(' ').replace(' ', '%c '),
                             'background:#ddf;color:black', color, 
'color:black');
        },
 
        _onMessage: function (e) {
                var imgBytes, index, textMsg, img;
 
-               console.info('onMessage: window.fullyLoadedAndReady: ' + 
window.fullyLoadedAndReady + ', bundlejsLoaded: ' + window.bundlejsLoaded);
                if (typeof (e.data) === 'string') {
                        textMsg = e.data;
                }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to