Skip to content

Commit ffd8364

Browse files
author
Gabriele Panico
committed
Removes unnecessary logging statements across multiple components and services to streamline code and improve performance. This includes the AppComponent, ProjectItemComponent, WebSocketJs, and WebsocketService.
1 parent 9ee0eb3 commit ffd8364

4 files changed

Lines changed: 13 additions & 16 deletions

File tree

src/app/app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,6 @@ export class AppComponent implements OnInit {
13451345

13461346
subscribeUnservedRequestCount = (unservedRequestCount) => {
13471347
if(unservedRequestCount && unservedRequestCount > 0){
1348-
this.logger.debug("subscribeUnservedRequestCount appIsInitialized::::",this.isInitialized)
13491348
if(this.isInitialized){
13501349
this.manageTabNotification('conv_unassigned', true, unservedRequestCount) //sound and alternate title
13511350
}

src/app/components/project-item/project-item.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ export class ProjectItemComponent implements OnInit {
358358
if (count > this.unservedRequestCount) {
359359
this.events.publish('unservedRequest:count', count);
360360
}
361-
this.logger.log('[PROJECT-ITEM] - unservedRequestCount', count);
362361
this.unservedRequestCount = count;
363362
}
364363

src/app/services/websocket/websocket-js.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,35 +65,34 @@ export class WebSocketJs {
6565
// WsRequestsMsgsComponent onInit() is got the request id from url params
6666

6767
ref(topic, calledby, onCreate, onUpdate, onData) {
68-
// this.logger.log('[WEBSOCKET-JS] ****** CALLING REF ****** ');
69-
this.logger.log('[WEBSOCKET-JS] - REF - calledby ', calledby);
70-
this.logger.log('[WEBSOCKET-JS] - REF - TOPIC ', topic);
71-
this.logger.log('[WEBSOCKET-JS] - REF - CALLBACKS', this.callbacks);
68+
// this.logger.log('[WEBSOCKET-JS] - REF - calledby ', calledby);
69+
// this.logger.log('[WEBSOCKET-JS] - REF - TOPIC ', topic);
70+
// this.logger.log('[WEBSOCKET-JS] - REF - CALLBACKS', this.callbacks);
7271

7372
if (!this.callbacks) {
7473
this.logger.log('[WEBSOCKET-JS] - REF OOOOPS! NOT CALLBACKS ***', this.callbacks);
7574
return
7675
}
7776

7877
this.callbacks.set(topic, { onCreate: onCreate, onUpdate: onUpdate, onData: onData });
79-
this.logger.log('[WEBSOCKET-JS] - CALLBACK-SET - callbacks', this.callbacks);
78+
// this.logger.log('[WEBSOCKET-JS] - CALLBACK-SET - callbacks', this.callbacks);
8079

8180
if (this.ws && this.ws.readyState == 1) {
82-
this.logger.log('[WEBSOCKET-JS] - REF - READY STATE ', this.ws.readyState);
83-
this.logger.log('[WEBSOCKET-JS] - REF - READY STATE = 1 > SUBSCRIBE TO TOPICS ');
81+
// this.logger.log('[WEBSOCKET-JS] - REF - READY STATE ', this.ws.readyState);
82+
// this.logger.log('[WEBSOCKET-JS] - REF - READY STATE = 1 > SUBSCRIBE TO TOPICS ');
8483

8584
this.subscribe(topic);
8685

8786
} else {
8887
// this.ws = new WebSocket("wss://tiledesk-server-pre.herokuapp.com/?token=JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZGRkMzBiZmYwMTk1ZjAwMTdmNzJjNmQiLCJlbWFpbCI6InByZWdpbm9AZjIxdGVzdC5pdCIsImZpcnN0bmFtZSI6Ikdpbm8iLCJsYXN0bmFtZSI6IlByZSIsImVtYWlsdmVyaWZpZWQiOnRydWUsImlhdCI6MTYwODgwNjY0MCwiYXVkIjoiaHR0cHM6Ly90aWxlZGVzay5jb20iLCJpc3MiOiJodHRwczovL3RpbGVkZXNrLmNvbSIsInN1YiI6InVzZXIiLCJqdGkiOiI1YmVmMDcxYy00ODBlLTQzYzQtOTRhYS05ZjQxYzMyNDcxMGQifQ.wv6uBn2P6H9wGb5WCYQkpPEScMU9PB1pBUzFouhJk20");
8988

90-
this.logger.log('[WEBSOCKET-JS] - REF - READY STATE ≠ 1 > OPEN WS AND THEN SUBSCRIBE TO TOPICS');
91-
this.logger.log('% »»» WebSocketJs WF *** REF *** WS 2 ', this.ws);
89+
// this.logger.log('[WEBSOCKET-JS] - REF - READY STATE ≠ 1 > OPEN WS AND THEN SUBSCRIBE TO TOPICS');
90+
// this.logger.log('% »»» WebSocketJs WF *** REF *** WS 2 ', this.ws);
9291

9392
var that = this;
9493
if (this.ws) {
9594
this.ws.addEventListener("open", function (event) {
96-
that.logger.log('[WEBSOCKET-JS] - REF - OPEN EVENT *** ', event);
95+
// that.logger.log('[WEBSOCKET-JS] - REF - OPEN EVENT *** ', event);
9796
that.subscribe(topic);
9897
});
9998
} else {
@@ -115,7 +114,7 @@ export class WebSocketJs {
115114
if (this.topics.indexOf(topic) === -1) {
116115
this.topics.push(topic);
117116
}
118-
this.logger.log('[WEBSOCKET-JS] - SUBSCRIBE TO TOPIC ', topic);
117+
// this.logger.log('[WEBSOCKET-JS] - SUBSCRIBE TO TOPIC ', topic);
119118

120119
var message = {
121120
action: 'subscribe',
@@ -127,7 +126,7 @@ export class WebSocketJs {
127126
},
128127
};
129128
var str = JSON.stringify(message);
130-
this.logger.log("[WEBSOCKET-JS] - SUBSCRIBE TO TOPIC - STRING TO SEND " + str, " FOR SUBSCRIBE TO TOPIC: ", topic);
129+
// this.logger.log("[WEBSOCKET-JS] - SUBSCRIBE TO TOPIC - STRING TO SEND " + str, " FOR SUBSCRIBE TO TOPIC: ", topic);
131130

132131
this.send(str, `SUBSCRIBE to ${topic}`);
133132
}

src/app/services/websocket/websocket.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ export class WebsocketService {
214214

215215

216216
}, function (data, notification) {
217-
self.logger.log("[WS-SERV] CHAT - CONVS - ON-DATA - DATA ", data);
218-
self.logger.log("[WS-SERV] CHAT - CONVS - ON-DATA - notification ", notification);
217+
// self.logger.log("[WS-SERV] CHAT - CONVS - ON-DATA - DATA ", data);
218+
// self.logger.log("[WS-SERV] CHAT - CONVS - ON-DATA - notification ", notification);
219219

220220
// console.log("[WS-SERV] CHAT - CONVS - ON-DATA - DATA notification > event > method ", notification.event.method);
221221
// if (notification.event.method === 'CREATE') {

0 commit comments

Comments
 (0)