Skip to content

Commit 86033cf

Browse files
committed
Change ws logging
1 parent a80c2c3 commit 86033cf

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

modules/webwindow.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ class LongPollSocket {
175175

176176
this.connid = parseInt(res);
177177
dummy_tmout = 100; // when establishing connection, wait a bit longer to submit dummy package
178-
console.log(`Get new longpoll connection with id ${this.connid}`);
178+
if (settings.Debug)
179+
console.log(`Get new longpoll connection with id ${this.connid}`);
179180
if (isFunc(this.onopen))
180181
this.onopen();
181182
} else if (this.connid === 'close') {
@@ -659,7 +660,7 @@ class WebWindowHandle {
659660
if (this.#state)
660661
return;
661662

662-
if (!first_time)
663+
if (!first_time && settings.Debug)
663664
console.log(`try connect window again ${new Date().toString()}`);
664665

665666
if (this.#ws) {
@@ -786,14 +787,11 @@ class WebWindowHandle {
786787
msg = msg.slice(i4 + 1);
787788

788789
if (chid === 0) {
789-
// console.log(`GET chid=0 message ${msg}`);
790790
if (msg === 'CLOSE') {
791791
this.close(true); // force closing of socket
792792
this.invokeReceiver(true, 'onWebsocketClosed');
793793
} else if (msg.indexOf('NEW_KEY=') === 0) {
794794
this.#new_key = msg.slice(8);
795-
if (settings.Debug)
796-
console.log('Got new key', this.#new_key);
797795
this.storeKeyInUrl();
798796
if (this.#ask_reload)
799797
this.askReload(true);
@@ -813,7 +811,8 @@ class WebWindowHandle {
813811
this.#ws.onclose = arg => {
814812
this.#ws = undefined;
815813
if ((this.#state > 0) || (arg === 'force_close')) {
816-
console.log('websocket closed');
814+
if (settings.Debug)
815+
console.log('websocket closed');
817816
this.#state = 0;
818817
this.invokeReceiver(true, 'onWebsocketClosed');
819818
}

0 commit comments

Comments
 (0)