瀏覽代碼

use logger instead of console

master
paweldomas 9 年之前
父節點
當前提交
b58f1cdd16

+ 5
- 4
app.js 查看文件

1
 /* global $, config, getRoomName */
1
 /* global $, config, getRoomName */
2
 /* application specific logic */
2
 /* application specific logic */
3
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
 
4
 
4
 import "babel-polyfill";
5
 import "babel-polyfill";
5
 import "jquery";
6
 import "jquery";
42
             'VideoChat', `Room: ${roomName}`, URL
43
             'VideoChat', `Room: ${roomName}`, URL
43
         );
44
         );
44
     } catch (e) {
45
     } catch (e) {
45
-        console.warn("Push history state failed with parameters:",
46
+        logger.warn("Push history state failed with parameters:",
46
             'VideoChat', `Room: ${roomName}`, URL, e);
47
             'VideoChat', `Room: ${roomName}`, URL, e);
47
         return e;
48
         return e;
48
     }
49
     }
145
         }).catch(function (err) {
146
         }).catch(function (err) {
146
             APP.UI.hideRingOverLay();
147
             APP.UI.hideRingOverLay();
147
             APP.API.notifyConferenceLeft(APP.conference.roomName);
148
             APP.API.notifyConferenceLeft(APP.conference.roomName);
148
-            console.error(err);
149
+            logger.error(err);
149
         });
150
         });
150
     }
151
     }
151
 }
152
 }
169
                 if (success) {
170
                 if (success) {
170
                     var now = APP.connectionTimes["configuration.fetched"] =
171
                     var now = APP.connectionTimes["configuration.fetched"] =
171
                         window.performance.now();
172
                         window.performance.now();
172
-                    console.log("(TIME) configuration fetched:\t", now);
173
+                    logger.log("(TIME) configuration fetched:\t", now);
173
                     init();
174
                     init();
174
                 } else {
175
                 } else {
175
                     // Show obtain config error,
176
                     // Show obtain config error,
189
 
190
 
190
 $(document).ready(function () {
191
 $(document).ready(function () {
191
     var now = APP.connectionTimes["document.ready"] = window.performance.now();
192
     var now = APP.connectionTimes["document.ready"] = window.performance.now();
192
-    console.log("(TIME) document ready:\t", now);
193
+    logger.log("(TIME) document ready:\t", now);
193
 
194
 
194
     URLProcessor.setConfigParametersFromUrl();
195
     URLProcessor.setConfigParametersFromUrl();
195
     APP.init();
196
     APP.init();

+ 25
- 23
conference.js 查看文件

1
 /* global $, APP, JitsiMeetJS, config, interfaceConfig */
1
 /* global $, APP, JitsiMeetJS, config, interfaceConfig */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 import {openConnection} from './connection';
4
 import {openConnection} from './connection';
3
 import Invite from './modules/UI/invite/Invite';
5
 import Invite from './modules/UI/invite/Invite';
4
 import ContactList from './modules/UI/side_pannels/contactlist/ContactList';
6
 import ContactList from './modules/UI/side_pannels/contactlist/ContactList';
166
     const method = muted ? 'mute' : 'unmute';
168
     const method = muted ? 'mute' : 'unmute';
167
 
169
 
168
     localMedia[method]().catch(reason => {
170
     localMedia[method]().catch(reason => {
169
-        console.warn(`${localMediaTypeString} ${method} was rejected:`, reason);
171
+        logger.warn(`${localMediaTypeString} ${method} was rejected:`, reason);
170
     });
172
     });
171
 }
173
 }
172
 
174
 
254
             });
256
             });
255
             return tracks;
257
             return tracks;
256
         }).catch(function (err) {
258
         }).catch(function (err) {
257
-            console.error(
259
+            logger.error(
258
                 'failed to create local tracks', options.devices, err);
260
                 'failed to create local tracks', options.devices, err);
259
             return Promise.reject(err);
261
             return Promise.reject(err);
260
         });
262
         });
310
         this._reject(err);
312
         this._reject(err);
311
     }
313
     }
312
     _onConferenceFailed(err, ...params) {
314
     _onConferenceFailed(err, ...params) {
313
-        console.error('CONFERENCE FAILED:', err, ...params);
315
+        logger.error('CONFERENCE FAILED:', err, ...params);
314
         APP.UI.hideRingOverLay();
316
         APP.UI.hideRingOverLay();
315
         switch (err) {
317
         switch (err) {
316
             // room is locked by the password
318
             // room is locked by the password
398
         }
400
         }
399
     }
401
     }
400
     _onConferenceError(err, ...params) {
402
     _onConferenceError(err, ...params) {
401
-        console.error('CONFERENCE Error:', err, params);
403
+        logger.error('CONFERENCE Error:', err, params);
402
         switch (err) {
404
         switch (err) {
403
         case ConferenceErrors.CHAT_ERROR:
405
         case ConferenceErrors.CHAT_ERROR:
404
             {
406
             {
407
             }
409
             }
408
             break;
410
             break;
409
         default:
411
         default:
410
-            console.error("Unknown error.");
412
+            logger.error("Unknown error.", err);
411
         }
413
         }
412
     }
414
     }
413
     _unsubscribe() {
415
     _unsubscribe() {
493
                 analytics.init();
495
                 analytics.init();
494
                 return createInitialLocalTracksAndConnect(options.roomName);
496
                 return createInitialLocalTracksAndConnect(options.roomName);
495
             }).then(([tracks, con]) => {
497
             }).then(([tracks, con]) => {
496
-                console.log('initialized with %s local tracks', tracks.length);
498
+                logger.log('initialized with %s local tracks', tracks.length);
497
                 APP.connection = connection = con;
499
                 APP.connection = connection = con;
498
                 this._bindConnectionFailedHandler(con);
500
                 this._bindConnectionFailedHandler(con);
499
                 this._createRoom(tracks);
501
                 this._createRoom(tracks);
546
                 // - item-not-found
548
                 // - item-not-found
547
                 // - connection dropped(closed by Strophe unexpectedly
549
                 // - connection dropped(closed by Strophe unexpectedly
548
                 //   possible due too many transport errors)
550
                 //   possible due too many transport errors)
549
-                console.error("XMPP connection error: " + errMsg);
551
+                logger.error("XMPP connection error: " + errMsg);
550
                 APP.UI.showPageReloadOverlay();
552
                 APP.UI.showPageReloadOverlay();
551
                 connection.removeEventListener(
553
                 connection.removeEventListener(
552
                     ConnectionEvents.CONNECTION_FAILED, handler);
554
                     ConnectionEvents.CONNECTION_FAILED, handler);
876
             } else if (track.isVideoTrack()) {
878
             } else if (track.isVideoTrack()) {
877
                 return this.useVideoStream(track);
879
                 return this.useVideoStream(track);
878
             } else {
880
             } else {
879
-                console.error(
881
+                logger.error(
880
                     "Ignored not an audio nor a video track: ", track);
882
                     "Ignored not an audio nor a video track: ", track);
881
                 return Promise.resolve();
883
                 return Promise.resolve();
882
             }
884
             }
968
     videoSwitchInProgress: false,
970
     videoSwitchInProgress: false,
969
     toggleScreenSharing (shareScreen = !this.isSharingScreen) {
971
     toggleScreenSharing (shareScreen = !this.isSharingScreen) {
970
         if (this.videoSwitchInProgress) {
972
         if (this.videoSwitchInProgress) {
971
-            console.warn("Switch in progress.");
973
+            logger.warn("Switch in progress.");
972
             return;
974
             return;
973
         }
975
         }
974
         if (!this.isDesktopSharingEnabled) {
976
         if (!this.isDesktopSharingEnabled) {
975
-            console.warn("Cannot toggle screen sharing: not supported.");
977
+            logger.warn("Cannot toggle screen sharing: not supported.");
976
             return;
978
             return;
977
         }
979
         }
978
 
980
 
1026
                 this.videoSwitchInProgress = false;
1028
                 this.videoSwitchInProgress = false;
1027
                 JitsiMeetJS.analytics.sendEvent(
1029
                 JitsiMeetJS.analytics.sendEvent(
1028
                     'conference.sharingDesktop.start');
1030
                     'conference.sharingDesktop.start');
1029
-                console.log('sharing local desktop');
1031
+                logger.log('sharing local desktop');
1030
             }).catch((err) => {
1032
             }).catch((err) => {
1031
                 // close external installation dialog to show the error.
1033
                 // close external installation dialog to show the error.
1032
                 if(externalInstallation)
1034
                 if(externalInstallation)
1038
                     return;
1040
                     return;
1039
                 }
1041
                 }
1040
 
1042
 
1041
-                console.error('failed to share local desktop', err);
1043
+                logger.error('failed to share local desktop', err);
1042
 
1044
 
1043
                 if (err.name === TrackErrors.FIREFOX_EXTENSION_NEEDED) {
1045
                 if (err.name === TrackErrors.FIREFOX_EXTENSION_NEEDED) {
1044
                     APP.UI.showExtensionRequiredDialog(
1046
                     APP.UI.showExtensionRequiredDialog(
1075
                 this.videoSwitchInProgress = false;
1077
                 this.videoSwitchInProgress = false;
1076
                 JitsiMeetJS.analytics.sendEvent(
1078
                 JitsiMeetJS.analytics.sendEvent(
1077
                     'conference.sharingDesktop.stop');
1079
                     'conference.sharingDesktop.stop');
1078
-                console.log('sharing local video');
1080
+                logger.log('sharing local video');
1079
             }).catch((err) => {
1081
             }).catch((err) => {
1080
                 this.useVideoStream(null);
1082
                 this.useVideoStream(null);
1081
                 this.videoSwitchInProgress = false;
1083
                 this.videoSwitchInProgress = false;
1082
-                console.error('failed to share local video', err);
1084
+                logger.error('failed to share local video', err);
1083
             });
1085
             });
1084
         }
1086
         }
1085
     },
1087
     },
1105
             if (user.isHidden())
1107
             if (user.isHidden())
1106
                 return;
1108
                 return;
1107
 
1109
 
1108
-            console.log('USER %s connnected', id, user);
1110
+            logger.log('USER %s connnected', id, user);
1109
             APP.API.notifyUserJoined(id);
1111
             APP.API.notifyUserJoined(id);
1110
             APP.UI.addUser(user);
1112
             APP.UI.addUser(user);
1111
 
1113
 
1113
             APP.UI.updateUserRole(user);
1115
             APP.UI.updateUserRole(user);
1114
         });
1116
         });
1115
         room.on(ConferenceEvents.USER_LEFT, (id, user) => {
1117
         room.on(ConferenceEvents.USER_LEFT, (id, user) => {
1116
-            console.log('USER %s LEFT', id, user);
1118
+            logger.log('USER %s LEFT', id, user);
1117
             APP.API.notifyUserLeft(id);
1119
             APP.API.notifyUserLeft(id);
1118
             APP.UI.removeUser(id, user.getDisplayName());
1120
             APP.UI.removeUser(id, user.getDisplayName());
1119
             APP.UI.onSharedVideoStop(id);
1121
             APP.UI.onSharedVideoStop(id);
1122
 
1124
 
1123
         room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => {
1125
         room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => {
1124
             if (this.isLocalId(id)) {
1126
             if (this.isLocalId(id)) {
1125
-                console.info(`My role changed, new role: ${role}`);
1127
+                logger.info(`My role changed, new role: ${role}`);
1126
                 if (this.isModerator !== room.isModerator()) {
1128
                 if (this.isModerator !== room.isModerator()) {
1127
                     this.isModerator = room.isModerator();
1129
                     this.isModerator = room.isModerator();
1128
                     APP.UI.updateLocalRole(room.isModerator());
1130
                     APP.UI.updateLocalRole(room.isModerator());
1180
             {
1182
             {
1181
                 this.audioLevelsMap[id] = lvl;
1183
                 this.audioLevelsMap[id] = lvl;
1182
                 if(config.debugAudioLevels)
1184
                 if(config.debugAudioLevels)
1183
-                    console.log("AudioLevel:" + id + "/" + lvl);
1185
+                    logger.log("AudioLevel:" + id + "/" + lvl);
1184
             }
1186
             }
1185
 
1187
 
1186
             APP.UI.setAudioLevel(id, lvl);
1188
             APP.UI.setAudioLevel(id, lvl);
1261
         });
1263
         });
1262
 
1264
 
1263
         room.on(ConferenceEvents.RECORDER_STATE_CHANGED, (status, error) => {
1265
         room.on(ConferenceEvents.RECORDER_STATE_CHANGED, (status, error) => {
1264
-            console.log("Received recorder status change: ", status, error);
1266
+            logger.log("Received recorder status change: ", status, error);
1265
             APP.UI.updateRecordingState(status);
1267
             APP.UI.updateRecordingState(status);
1266
         });
1268
         });
1267
 
1269
 
1497
                 })
1499
                 })
1498
                 .then(([stream]) => {
1500
                 .then(([stream]) => {
1499
                     this.useVideoStream(stream);
1501
                     this.useVideoStream(stream);
1500
-                    console.log('switched local video device');
1502
+                    logger.log('switched local video device');
1501
                     APP.settings.setCameraDeviceId(cameraDeviceId, true);
1503
                     APP.settings.setCameraDeviceId(cameraDeviceId, true);
1502
                 })
1504
                 })
1503
                 .catch((err) => {
1505
                 .catch((err) => {
1519
                 })
1521
                 })
1520
                 .then(([stream]) => {
1522
                 .then(([stream]) => {
1521
                     this.useAudioStream(stream);
1523
                     this.useAudioStream(stream);
1522
-                    console.log('switched local audio device');
1524
+                    logger.log('switched local audio device');
1523
                     APP.settings.setMicDeviceId(micDeviceId, true);
1525
                     APP.settings.setMicDeviceId(micDeviceId, true);
1524
                 })
1526
                 })
1525
                 .catch((err) => {
1527
                 .catch((err) => {
1535
                 JitsiMeetJS.analytics.sendEvent(
1537
                 JitsiMeetJS.analytics.sendEvent(
1536
                     'settings.changeDevice.audioOut');
1538
                     'settings.changeDevice.audioOut');
1537
                 APP.settings.setAudioOutputDeviceId(audioOutputDeviceId)
1539
                 APP.settings.setAudioOutputDeviceId(audioOutputDeviceId)
1538
-                    .then(() => console.log('changed audio output device'))
1540
+                    .then(() => logger.log('changed audio output device'))
1539
                     .catch((err) => {
1541
                     .catch((err) => {
1540
-                        console.warn('Failed to change audio output device. ' +
1542
+                        logger.warn('Failed to change audio output device. ' +
1541
                             'Default or previously set audio output device ' +
1543
                             'Default or previously set audio output device ' +
1542
                             'will be used instead.', err);
1544
                             'will be used instead.', err);
1543
                         APP.UI.setSelectedAudioOutputFromSettings();
1545
                         APP.UI.setSelectedAudioOutputFromSettings();

+ 3
- 1
connection.js 查看文件

1
 /* global APP, JitsiMeetJS, config */
1
 /* global APP, JitsiMeetJS, config */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 import AuthHandler from './modules/UI/authentication/AuthHandler';
4
 import AuthHandler from './modules/UI/authentication/AuthHandler';
3
 import jitsiLocalStorage from './modules/util/JitsiLocalStorage';
5
 import jitsiLocalStorage from './modules/util/JitsiLocalStorage';
4
 
6
 
84
 
86
 
85
         function handleConnectionFailed(err) {
87
         function handleConnectionFailed(err) {
86
             unsubscribe();
88
             unsubscribe();
87
-            console.error("CONNECTION FAILED:", err);
89
+            logger.error("CONNECTION FAILED:", err);
88
             reject(err);
90
             reject(err);
89
         }
91
         }
90
 
92
 

+ 4
- 2
modules/API/API.js 查看文件

1
 /* global APP, getConfigParamsFromUrl */
1
 /* global APP, getConfigParamsFromUrl */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 /**
4
 /**
3
  * Implements API class that communicates with external api class
5
  * Implements API class that communicates with external api class
4
  * and provides interface to access Jitsi Meet features by external
6
  * and provides interface to access Jitsi Meet features by external
131
     switch (message.type) {
133
     switch (message.type) {
132
         case "eventStatus":
134
         case "eventStatus":
133
             if(!message.name || !message.value) {
135
             if(!message.name || !message.value) {
134
-                console.warn("Unknown system message format", message);
136
+                logger.warn("Unknown system message format", message);
135
                 break;
137
                 break;
136
             }
138
             }
137
             events[message.name] = message.value;
139
             events[message.name] = message.value;
138
             break;
140
             break;
139
         default:
141
         default:
140
-            console.warn("Unknown system message type", message);
142
+            logger.warn("Unknown system message type", message);
141
     }
143
     }
142
 }
144
 }
143
 
145
 

+ 6
- 4
modules/API/external/external_api.js 查看文件

1
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
+
1
 /**
3
 /**
2
  * Implements API class that embeds Jitsi Meet in external applications.
4
  * Implements API class that embeds Jitsi Meet in external applications.
3
  */
5
  */
72
  */
74
  */
73
 function changeEventStatus(postis, event, status) {
75
 function changeEventStatus(postis, event, status) {
74
     if(!(event in events)) {
76
     if(!(event in events)) {
75
-        console.error("Not supported event name.");
77
+        logger.error("Not supported event name.");
76
         return;
78
         return;
77
     }
79
     }
78
     sendMessage(postis, {
80
     sendMessage(postis, {
174
  */
176
  */
175
 JitsiMeetExternalAPI.prototype.executeCommand = function(name, argumentsList) {
177
 JitsiMeetExternalAPI.prototype.executeCommand = function(name, argumentsList) {
176
     if(!(name in commands)) {
178
     if(!(name in commands)) {
177
-        console.error("Not supported command name.");
179
+        logger.error("Not supported command name.");
178
         return;
180
         return;
179
     }
181
     }
180
     var argumentsArray = argumentsList;
182
     var argumentsArray = argumentsList;
306
  */
308
  */
307
 JitsiMeetExternalAPI.prototype.addEventListener = function(event, listener) {
309
 JitsiMeetExternalAPI.prototype.addEventListener = function(event, listener) {
308
     if(!(event in events)) {
310
     if(!(event in events)) {
309
-        console.error("Not supported event name.");
311
+        logger.error("Not supported event name.");
310
         return;
312
         return;
311
     }
313
     }
312
     // We cannot remove listeners from postis that's why we are handling the
314
     // We cannot remove listeners from postis that's why we are handling the
328
 JitsiMeetExternalAPI.prototype.removeEventListener = function(event) {
330
 JitsiMeetExternalAPI.prototype.removeEventListener = function(event) {
329
     if(!(event in this.eventHandlers))
331
     if(!(event in this.eventHandlers))
330
     {
332
     {
331
-        console.error("The event " + event + " is not registered.");
333
+        logger.error("The event " + event + " is not registered.");
332
         return;
334
         return;
333
     }
335
     }
334
     delete this.eventHandlers[event];
336
     delete this.eventHandlers[event];

+ 2
- 1
modules/FollowMe.js 查看文件

13
  * See the License for the specific language governing permissions and
13
  * See the License for the specific language governing permissions and
14
  * limitations under the License.
14
  * limitations under the License.
15
  */
15
  */
16
+const logger = require("jitsi-meet-logger").getLogger(__filename);
16
 
17
 
17
 import UIEvents from '../service/UI/UIEvents';
18
 import UIEvents from '../service/UI/UIEvents';
18
 import VideoLayout from './UI/videolayout/VideoLayout';
19
 import VideoLayout from './UI/videolayout/VideoLayout';
308
 
309
 
309
         if (!this._conference.isParticipantModerator(id))
310
         if (!this._conference.isParticipantModerator(id))
310
         {
311
         {
311
-            console.warn('Received follow-me command ' +
312
+            logger.warn('Received follow-me command ' +
312
                 'not from moderator');
313
                 'not from moderator');
313
             return;
314
             return;
314
         }
315
         }

+ 5
- 3
modules/UI/UI.js 查看文件

1
 /* global APP, JitsiMeetJS, $, config, interfaceConfig, toastr */
1
 /* global APP, JitsiMeetJS, $, config, interfaceConfig, toastr */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 var UI = {};
4
 var UI = {};
3
 
5
 
4
 import Chat from "./side_pannels/chat/Chat";
6
 import Chat from "./side_pannels/chat/Chat";
501
         VideoLayout.changeLocalVideo(track);
503
         VideoLayout.changeLocalVideo(track);
502
         break;
504
         break;
503
     default:
505
     default:
504
-        console.error("Unknown stream type: " + track.getType());
506
+        logger.error("Unknown stream type: " + track.getType());
505
         break;
507
         break;
506
     }
508
     }
507
 };
509
 };
539
     if (etherpadManager || !config.etherpad_base || !name) {
541
     if (etherpadManager || !config.etherpad_base || !name) {
540
         return;
542
         return;
541
     }
543
     }
542
-    console.log('Etherpad is enabled');
544
+    logger.log('Etherpad is enabled');
543
     etherpadManager
545
     etherpadManager
544
         = new EtherpadManager(config.etherpad_base, name, eventEmitter);
546
         = new EtherpadManager(config.etherpad_base, name, eventEmitter);
545
     Toolbar.showEtherpadButton();
547
     Toolbar.showEtherpadButton();
737
 
739
 
738
 // FIXME check if someone user this
740
 // FIXME check if someone user this
739
 UI.showLoginPopup = function(callback) {
741
 UI.showLoginPopup = function(callback) {
740
-    console.log('password is required');
742
+    logger.log('password is required');
741
 
743
 
742
     let message = (
744
     let message = (
743
         `<input name="username" type="text"
745
         `<input name="username" type="text"

+ 8
- 7
modules/UI/authentication/AuthHandler.js 查看文件

1
 /* global APP, config, JitsiMeetJS, Promise */
1
 /* global APP, config, JitsiMeetJS, Promise */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
3
 
3
 import LoginDialog from './LoginDialog';
4
 import LoginDialog from './LoginDialog';
4
 import UIUtil from '../util/UIUtil';
5
 import UIUtil from '../util/UIUtil';
74
 function initJWTTokenListener(room) {
75
 function initJWTTokenListener(room) {
75
     var listener = function (event) {
76
     var listener = function (event) {
76
         if (externalAuthWindow !== event.source) {
77
         if (externalAuthWindow !== event.source) {
77
-            console.warn("Ignored message not coming " +
78
+            logger.warn("Ignored message not coming " +
78
                 "from external authnetication window");
79
                 "from external authnetication window");
79
             return;
80
             return;
80
         }
81
         }
81
         if (event.data && event.data.jwtToken) {
82
         if (event.data && event.data.jwtToken) {
82
             config.token = event.data.jwtToken;
83
             config.token = event.data.jwtToken;
83
-            console.info("Received JWT token:", config.token);
84
+            logger.info("Received JWT token:", config.token);
84
             var roomName = room.getName();
85
             var roomName = room.getName();
85
             openConnection({retry: false, roomName: roomName })
86
             openConnection({retry: false, roomName: roomName })
86
                 .then(function (connection) {
87
                 .then(function (connection) {
97
                         // to upgrade user's role
98
                         // to upgrade user's role
98
                         room.room.moderator.authenticate()
99
                         room.room.moderator.authenticate()
99
                             .then(function () {
100
                             .then(function () {
100
-                                console.info("User role upgrade done !");
101
+                                logger.info("User role upgrade done !");
101
                                 unregister();
102
                                 unregister();
102
                             }).catch(function (err, errCode) {
103
                             }).catch(function (err, errCode) {
103
-                                console.error(
104
+                                logger.error(
104
                                     "Authentication failed: ", err, errCode);
105
                                     "Authentication failed: ", err, errCode);
105
                                 unregister();
106
                                 unregister();
106
                             }
107
                             }
108
                     }).catch(function (error, code) {
109
                     }).catch(function (error, code) {
109
                         unregister();
110
                         unregister();
110
                         connection.disconnect();
111
                         connection.disconnect();
111
-                        console.error(
112
+                        logger.error(
112
                             'Authentication failed on the new connection',
113
                             'Authentication failed on the new connection',
113
                             error, code);
114
                             error, code);
114
                     });
115
                     });
115
                 }, function (err) {
116
                 }, function (err) {
116
                     unregister();
117
                     unregister();
117
-                    console.error("Failed to open new connection", err);
118
+                    logger.error("Failed to open new connection", err);
118
                 });
119
                 });
119
         }
120
         }
120
     };
121
     };
161
             }).catch(function (error, code) {
162
             }).catch(function (error, code) {
162
                 connection.disconnect();
163
                 connection.disconnect();
163
 
164
 
164
-                console.error('Auth on the fly failed', error);
165
+                logger.error('Auth on the fly failed', error);
165
 
166
 
166
                 loginDialog.displayError(
167
                 loginDialog.displayError(
167
                     'connection.GET_SESSION_ID_ERROR', {code: code});
168
                     'connection.GET_SESSION_ID_ERROR', {code: code});

+ 2
- 1
modules/UI/avatar/Avatar.js 查看文件

22
  */
22
  */
23
 
23
 
24
 /* global MD5, config, interfaceConfig, APP */
24
 /* global MD5, config, interfaceConfig, APP */
25
+const logger = require("jitsi-meet-logger").getLogger(__filename);
25
 
26
 
26
 let users = {};
27
 let users = {};
27
 
28
 
110
         let random = !avatarId || avatarId.indexOf('@') < 0;
111
         let random = !avatarId || avatarId.indexOf('@') < 0;
111
 
112
 
112
         if (!avatarId) {
113
         if (!avatarId) {
113
-            console.warn(
114
+            logger.warn(
114
                 `No avatar stored yet for ${userId} - using ID as avatar ID`);
115
                 `No avatar stored yet for ${userId} - using ID as avatar ID`);
115
             avatarId = userId;
116
             avatarId = userId;
116
         }
117
         }

+ 2
- 1
modules/UI/invite/Invite.js 查看文件

1
 /* global JitsiMeetJS, APP */
1
 /* global JitsiMeetJS, APP */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
3
 
3
 import InviteDialogView from './InviteDialogView';
4
 import InviteDialogView from './InviteDialogView';
4
 import createRoomLocker from './RoomLocker';
5
 import createRoomLocker from './RoomLocker';
28
         this.conference.on(ConferenceEvents.LOCK_STATE_CHANGED,
29
         this.conference.on(ConferenceEvents.LOCK_STATE_CHANGED,
29
             (locked, error) => {
30
             (locked, error) => {
30
 
31
 
31
-            console.log("Received channel password lock change: ", locked,
32
+            logger.log("Received channel password lock change: ", locked,
32
                 error);
33
                 error);
33
 
34
 
34
             if (!locked) {
35
             if (!locked) {

+ 2
- 1
modules/UI/invite/InviteDialogView.js 查看文件

1
 /* global $, APP, JitsiMeetJS */
1
 /* global $, APP, JitsiMeetJS */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
3
 
3
 /**
4
 /**
4
  * Substate for password
5
  * Substate for password
312
                     this.blur();
313
                     this.blur();
313
                 }
314
                 }
314
                 catch (err) {
315
                 catch (err) {
315
-                    console.error('error when copy the text');
316
+                    logger.error('error when copy the text');
316
                 }
317
                 }
317
             }
318
             }
318
         });
319
         });

+ 6
- 4
modules/UI/invite/RoomLocker.js 查看文件

1
 /* global APP, JitsiMeetJS */
1
 /* global APP, JitsiMeetJS */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 import RequirePasswordDialog from './RequirePasswordDialog';
4
 import RequirePasswordDialog from './RequirePasswordDialog';
3
 
5
 
4
 /**
6
 /**
6
  * because server doesn't support that.
8
  * because server doesn't support that.
7
  */
9
  */
8
 function notifyPasswordNotSupported () {
10
 function notifyPasswordNotSupported () {
9
-    console.warn('room passwords not supported');
11
+    logger.warn('room passwords not supported');
10
     APP.UI.messageHandler.showError(
12
     APP.UI.messageHandler.showError(
11
         "dialog.warning", "dialog.passwordNotSupported");
13
         "dialog.warning", "dialog.passwordNotSupported");
12
 }
14
 }
16
  * @param {Error} err error
18
  * @param {Error} err error
17
  */
19
  */
18
 function notifyPasswordFailed(err) {
20
 function notifyPasswordFailed(err) {
19
-    console.warn('setting password failed', err);
21
+    logger.warn('setting password failed', err);
20
     APP.UI.messageHandler.showError(
22
     APP.UI.messageHandler.showError(
21
         "dialog.lockTitle", "dialog.lockMessage");
23
         "dialog.lockTitle", "dialog.lockMessage");
22
 }
24
 }
64
                 if (!password)
66
                 if (!password)
65
                     lockedElsewhere = false;
67
                     lockedElsewhere = false;
66
             }).catch(function (err) {
68
             }).catch(function (err) {
67
-                console.error(err);
69
+                logger.error(err);
68
                 if (err === ConferenceErrors.PASSWORD_NOT_SUPPORTED) {
70
                 if (err === ConferenceErrors.PASSWORD_NOT_SUPPORTED) {
69
                     notifyPasswordNotSupported();
71
                     notifyPasswordNotSupported();
70
                 } else {
72
                 } else {
113
                     // pass stays between attempts
115
                     // pass stays between attempts
114
                     password = null;
116
                     password = null;
115
                     if (reason !== APP.UI.messageHandler.CANCEL)
117
                     if (reason !== APP.UI.messageHandler.CANCEL)
116
-                        console.error(reason);
118
+                        logger.error(reason);
117
                 }
119
                 }
118
             );
120
             );
119
         },
121
         },

+ 4
- 2
modules/UI/recording/Recording.js 查看文件

14
  * See the License for the specific language governing permissions and
14
  * See the License for the specific language governing permissions and
15
  * limitations under the License.
15
  * limitations under the License.
16
  */
16
  */
17
+const logger = require("jitsi-meet-logger").getLogger(__filename);
18
+
17
 import UIEvents from "../../../service/UI/UIEvents";
19
 import UIEvents from "../../../service/UI/UIEvents";
18
 import UIUtil from '../util/UIUtil';
20
 import UIUtil from '../util/UIUtil';
19
 import VideoLayout from '../videolayout/VideoLayout';
21
 import VideoLayout from '../videolayout/VideoLayout';
327
                         }).catch(
329
                         }).catch(
328
                             reason => {
330
                             reason => {
329
                                 if (reason !== APP.UI.messageHandler.CANCEL)
331
                                 if (reason !== APP.UI.messageHandler.CANCEL)
330
-                                    console.error(reason);
332
+                                    logger.error(reason);
331
                                 else
333
                                 else
332
                                     JitsiMeetJS.analytics.sendEvent(
334
                                     JitsiMeetJS.analytics.sendEvent(
333
                                         'recording.canceled');
335
                                         'recording.canceled');
350
                         }).catch(
352
                         }).catch(
351
                             reason => {
353
                             reason => {
352
                                 if (reason !== APP.UI.messageHandler.CANCEL)
354
                                 if (reason !== APP.UI.messageHandler.CANCEL)
353
-                                    console.error(reason);
355
+                                    logger.error(reason);
354
                                 else
356
                                 else
355
                                     JitsiMeetJS.analytics.sendEvent(
357
                                     JitsiMeetJS.analytics.sendEvent(
356
                                         'recording.canceled');
358
                                         'recording.canceled');

+ 2
- 1
modules/UI/reload_overlay/PageReloadOverlay.js 查看文件

1
 /* global $, APP, AJS */
1
 /* global $, APP, AJS */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
3
 
3
 import Overlay from '../overlay/Overlay';
4
 import Overlay from '../overlay/Overlay';
4
 
5
 
82
             }
83
             }
83
         }.bind(this), 1000);
84
         }.bind(this), 1000);
84
 
85
 
85
-        console.info(
86
+        logger.info(
86
             "The conference will be reloaded after "
87
             "The conference will be reloaded after "
87
                 + this.timeLeft + " seconds.");
88
                 + this.timeLeft + " seconds.");
88
     }
89
     }

+ 8
- 7
modules/UI/shared_video/SharedVideo.js 查看文件

1
 /* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError,
1
 /* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError,
2
 JitsiMeetJS */
2
 JitsiMeetJS */
3
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
 
4
 
4
 import UIUtil from '../util/UIUtil';
5
 import UIUtil from '../util/UIUtil';
5
 import UIEvents from '../../../service/UI/UIEvents';
6
 import UIEvents from '../../../service/UI/UIEvents';
75
                         JitsiMeetJS.analytics.sendEvent('sharedvideo.started');
76
                         JitsiMeetJS.analytics.sendEvent('sharedvideo.started');
76
                     },
77
                     },
77
                     err => {
78
                     err => {
78
-                        console.log('SHARED VIDEO CANCELED', err);
79
+                        logger.log('SHARED VIDEO CANCELED', err);
79
                         JitsiMeetJS.analytics.sendEvent('sharedvideo.canceled');
80
                         JitsiMeetJS.analytics.sendEvent('sharedvideo.canceled');
80
                     }
81
                     }
81
             );
82
             );
277
         };
278
         };
278
 
279
 
279
         window.onPlayerError = function(event) {
280
         window.onPlayerError = function(event) {
280
-            console.error("Error in the player:", event.data);
281
+            logger.error("Error in the player:", event.data);
281
             // store the error player, so we can remove it
282
             // store the error player, so we can remove it
282
             self.errorInPlayer = event.target;
283
             self.errorInPlayer = event.target;
283
         };
284
         };
313
                 && player.getVolume() != attributes.volume) {
314
                 && player.getVolume() != attributes.volume) {
314
 
315
 
315
                 player.setVolume(attributes.volume);
316
                 player.setVolume(attributes.volume);
316
-                console.info("Player change of volume:" + attributes.volume);
317
+                logger.info("Player change of volume:" + attributes.volume);
317
                 this.showSharedVideoMutedPopup(false);
318
                 this.showSharedVideoMutedPopup(false);
318
             }
319
             }
319
 
320
 
337
     processTime (player, attributes, forceSeek)
338
     processTime (player, attributes, forceSeek)
338
     {
339
     {
339
         if(forceSeek) {
340
         if(forceSeek) {
340
-            console.info("Player seekTo:", attributes.time);
341
+            logger.info("Player seekTo:", attributes.time);
341
             player.seekTo(attributes.time);
342
             player.seekTo(attributes.time);
342
             return;
343
             return;
343
         }
344
         }
349
         // if we drift more than the interval for checking
350
         // if we drift more than the interval for checking
350
         // sync, the interval is in milliseconds
351
         // sync, the interval is in milliseconds
351
         if(diff > updateInterval/1000) {
352
         if(diff > updateInterval/1000) {
352
-            console.info("Player seekTo:", attributes.time,
353
+            logger.info("Player seekTo:", attributes.time,
353
                 " current time is:", currentPosition, " diff:", diff);
354
                 " current time is:", currentPosition, " diff:", diff);
354
             player.seekTo(attributes.time);
355
             player.seekTo(attributes.time);
355
         }
356
         }
669
  * Removes RemoteVideo from the page.
670
  * Removes RemoteVideo from the page.
670
  */
671
  */
671
 SharedVideoThumb.prototype.remove = function () {
672
 SharedVideoThumb.prototype.remove = function () {
672
-    console.log("Remove shared video thumb", this.id);
673
+    logger.log("Remove shared video thumb", this.id);
673
 
674
 
674
     // Make sure that the large video is updated if are removing its
675
     // Make sure that the large video is updated if are removing its
675
     // corresponding small video.
676
     // corresponding small video.
686
  */
687
  */
687
 SharedVideoThumb.prototype.setDisplayName = function(displayName) {
688
 SharedVideoThumb.prototype.setDisplayName = function(displayName) {
688
     if (!this.container) {
689
     if (!this.container) {
689
-        console.warn( "Unable to set displayName - " + this.videoSpanId +
690
+        logger.warn( "Unable to set displayName - " + this.videoSpanId +
690
             " does not exist");
691
             " does not exist");
691
         return;
692
         return;
692
     }
693
     }

+ 3
- 1
modules/UI/side_pannels/contactlist/ContactListView.js 查看文件

1
 /* global $, APP, interfaceConfig */
1
 /* global $, APP, interfaceConfig */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 import Avatar from '../../avatar/Avatar';
4
 import Avatar from '../../avatar/Avatar';
3
 import UIEvents from '../../../../service/UI/UIEvents';
5
 import UIEvents from '../../../../service/UI/UIEvents';
4
 import UIUtil from '../../util/UIUtil';
6
 import UIUtil from '../../util/UIUtil';
27
     numberOfContacts += delta;
29
     numberOfContacts += delta;
28
 
30
 
29
     if (numberOfContacts <= 0) {
31
     if (numberOfContacts <= 0) {
30
-        console.error("Invalid number of participants: " + numberOfContacts);
32
+        logger.error("Invalid number of participants: " + numberOfContacts);
31
         return;
33
         return;
32
     }
34
     }
33
 
35
 

+ 3
- 2
modules/UI/util/MessageHandler.js 查看文件

1
 /* global $, APP, toastr */
1
 /* global $, APP, toastr */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
3
 
3
 import UIUtil from './UIUtil';
4
 import UIUtil from './UIUtil';
4
 import jitsiLocalStorage from '../../util/JitsiLocalStorage';
5
 import jitsiLocalStorage from '../../util/JitsiLocalStorage';
79
 function dontShowAgainSubmitFunctionWrapper(options, submitFunction) {
80
 function dontShowAgainSubmitFunctionWrapper(options, submitFunction) {
80
     if(isDontShowAgainEnabled(options)) {
81
     if(isDontShowAgainEnabled(options)) {
81
         return (...args) => {
82
         return (...args) => {
82
-            console.debug(args, options.buttonValues);
83
+            logger.debug(args, options.buttonValues);
83
             //args[1] is the value associated with the pressed button
84
             //args[1] is the value associated with the pressed button
84
             if(!options.buttonValues || options.buttonValues.length === 0
85
             if(!options.buttonValues || options.buttonValues.length === 0
85
                 || options.buttonValues.indexOf(args[1]) !== -1 ) {
86
                 || options.buttonValues.indexOf(args[1]) !== -1 ) {
409
      */
410
      */
410
     openReportDialog: function(titleKey, msgKey, error) {
411
     openReportDialog: function(titleKey, msgKey, error) {
411
         this.openMessageDialog(titleKey, msgKey);
412
         this.openMessageDialog(titleKey, msgKey);
412
-        console.log(error);
413
+        logger.log(error);
413
         //FIXME send the error to the server
414
         //FIXME send the error to the server
414
     },
415
     },
415
 
416
 

+ 2
- 1
modules/UI/videolayout/LargeVideoManager.js 查看文件

1
 /* global $, APP, interfaceConfig */
1
 /* global $, APP, interfaceConfig */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
3
 
3
 import Avatar from "../avatar/Avatar";
4
 import Avatar from "../avatar/Avatar";
4
 import {createDeferred} from '../../util/helpers';
5
 import {createDeferred} from '../../util/helpers';
126
             const { id, stream, videoType, resolve } = this.newStreamData;
127
             const { id, stream, videoType, resolve } = this.newStreamData;
127
             this.newStreamData = null;
128
             this.newStreamData = null;
128
 
129
 
129
-            console.info("hover in %s", id);
130
+            logger.info("hover in %s", id);
130
             this.state = videoType;
131
             this.state = videoType;
131
             const container = this.getContainer(this.state);
132
             const container = this.getContainer(this.state);
132
             container.setStream(stream, videoType);
133
             container.setStream(stream, videoType);

+ 3
- 1
modules/UI/videolayout/LocalVideo.js 查看文件

1
 /* global $, config, interfaceConfig, APP, JitsiMeetJS */
1
 /* global $, config, interfaceConfig, APP, JitsiMeetJS */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 import ConnectionIndicator from "./ConnectionIndicator";
4
 import ConnectionIndicator from "./ConnectionIndicator";
3
 import UIUtil from "../util/UIUtil";
5
 import UIUtil from "../util/UIUtil";
4
 import UIEvents from "../../../service/UI/UIEvents";
6
 import UIEvents from "../../../service/UI/UIEvents";
40
  */
42
  */
41
 LocalVideo.prototype.setDisplayName = function(displayName) {
43
 LocalVideo.prototype.setDisplayName = function(displayName) {
42
     if (!this.container) {
44
     if (!this.container) {
43
-        console.warn(
45
+        logger.warn(
44
                 "Unable to set displayName - " + this.videoSpanId +
46
                 "Unable to set displayName - " + this.videoSpanId +
45
                 " does not exist");
47
                 " does not exist");
46
         return;
48
         return;

+ 6
- 5
modules/UI/videolayout/RemoteVideo.js 查看文件

1
 /* global $, APP, interfaceConfig */
1
 /* global $, APP, interfaceConfig */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
3
 
3
 import ConnectionIndicator from './ConnectionIndicator';
4
 import ConnectionIndicator from './ConnectionIndicator';
4
 
5
 
191
         }
192
         }
192
     }).catch(e => {
193
     }).catch(e => {
193
         //currently shouldn't be called
194
         //currently shouldn't be called
194
-        console.error(e);
195
+        logger.error(e);
195
     });
196
     });
196
 
197
 
197
     this.popover.forceHide();
198
     this.popover.forceHide();
343
         this.wasVideoPlayed = false;
344
         this.wasVideoPlayed = false;
344
     }
345
     }
345
 
346
 
346
-    console.info((isVideo ? "Video" : "Audio") +
347
+    logger.info((isVideo ? "Video" : "Audio") +
347
                  " removed " + this.id, select);
348
                  " removed " + this.id, select);
348
 
349
 
349
     // when removing only the video element and we are on stage
350
     // when removing only the video element and we are on stage
408
         }
409
         }
409
     }
410
     }
410
 
411
 
411
-    console.debug(this.id + " thumbnail is connection active ? " + isActive);
412
+    logger.debug(this.id + " thumbnail is connection active ? " + isActive);
412
 
413
 
413
     // Update 'mutedWhileDisconnected' flag
414
     // Update 'mutedWhileDisconnected' flag
414
     this._figureOutMutedWhileDisconnected(!isActive);
415
     this._figureOutMutedWhileDisconnected(!isActive);
427
  * Removes RemoteVideo from the page.
428
  * Removes RemoteVideo from the page.
428
  */
429
  */
429
 RemoteVideo.prototype.remove = function () {
430
 RemoteVideo.prototype.remove = function () {
430
-    console.log("Remove thumbnail", this.id);
431
+    logger.log("Remove thumbnail", this.id);
431
     this.removeConnectionIndicator();
432
     this.removeConnectionIndicator();
432
     // Make sure that the large video is updated if are removing its
433
     // Make sure that the large video is updated if are removing its
433
     // corresponding small video.
434
     // corresponding small video.
586
  */
587
  */
587
 RemoteVideo.prototype.setDisplayName = function(displayName) {
588
 RemoteVideo.prototype.setDisplayName = function(displayName) {
588
     if (!this.container) {
589
     if (!this.container) {
589
-        console.warn( "Unable to set displayName - " + this.videoSpanId +
590
+        logger.warn( "Unable to set displayName - " + this.videoSpanId +
590
                 " does not exist");
591
                 " does not exist");
591
         return;
592
         return;
592
     }
593
     }

+ 5
- 3
modules/UI/videolayout/SmallVideo.js 查看文件

1
 /* global $, JitsiMeetJS, interfaceConfig */
1
 /* global $, JitsiMeetJS, interfaceConfig */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 import Avatar from "../avatar/Avatar";
4
 import Avatar from "../avatar/Avatar";
3
 import UIUtil from "../util/UIUtil";
5
 import UIUtil from "../util/UIUtil";
4
 import UIEvents from "../../../service/UI/UIEvents";
6
 import UIEvents from "../../../service/UI/UIEvents";
503
             // Init avatar
505
             // Init avatar
504
             this.avatarChanged(Avatar.getAvatarUrl(this.id));
506
             this.avatarChanged(Avatar.getAvatarUrl(this.id));
505
         } else {
507
         } else {
506
-            console.error("Unable to init avatar - no id", this);
508
+            logger.error("Unable to init avatar - no id", this);
507
             return;
509
             return;
508
         }
510
         }
509
     }
511
     }
561
         return;
563
         return;
562
 
564
 
563
     if (!this.container) {
565
     if (!this.container) {
564
-        console.warn( "Unable to set dominant speaker indicator - "
566
+        logger.warn( "Unable to set dominant speaker indicator - "
565
             + this.videoSpanId + " does not exist");
567
             + this.videoSpanId + " does not exist");
566
         return;
568
         return;
567
     }
569
     }
589
  */
591
  */
590
 SmallVideo.prototype.showRaisedHandIndicator = function (show) {
592
 SmallVideo.prototype.showRaisedHandIndicator = function (show) {
591
     if (!this.container) {
593
     if (!this.container) {
592
-        console.warn( "Unable to raised hand indication - "
594
+        logger.warn( "Unable to raised hand indication - "
593
             + this.videoSpanId + " does not exist");
595
             + this.videoSpanId + " does not exist");
594
         return;
596
         return;
595
     }
597
     }

+ 19
- 18
modules/UI/videolayout/VideoLayout.js 查看文件

1
 /* global config, APP, $, interfaceConfig */
1
 /* global config, APP, $, interfaceConfig */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
3
 
3
 import FilmStrip from "./FilmStrip";
4
 import FilmStrip from "./FilmStrip";
4
 import UIEvents from "../../../service/UI/UIEvents";
5
 import UIEvents from "../../../service/UI/UIEvents";
261
         if (lastVisible.length) {
262
         if (lastVisible.length) {
262
             let id = getPeerContainerResourceId(lastVisible[0]);
263
             let id = getPeerContainerResourceId(lastVisible[0]);
263
             if (remoteVideos[id]) {
264
             if (remoteVideos[id]) {
264
-                console.info("electLastVisibleVideo: " + id);
265
+                logger.info("electLastVisibleVideo: " + id);
265
                 return id;
266
                 return id;
266
             }
267
             }
267
             // The RemoteVideo was removed (but the DOM elements may still
268
             // The RemoteVideo was removed (but the DOM elements may still
268
             // exist).
269
             // exist).
269
         }
270
         }
270
 
271
 
271
-        console.info("Last visible video no longer exists");
272
+        logger.info("Last visible video no longer exists");
272
         thumbs = FilmStrip.getThumbs().remoteThumbs;
273
         thumbs = FilmStrip.getThumbs().remoteThumbs;
273
         if (thumbs.length) {
274
         if (thumbs.length) {
274
             let id = getPeerContainerResourceId(thumbs[0]);
275
             let id = getPeerContainerResourceId(thumbs[0]);
275
             if (remoteVideos[id]) {
276
             if (remoteVideos[id]) {
276
-                console.info("electLastVisibleVideo: " + id);
277
+                logger.info("electLastVisibleVideo: " + id);
277
                 return id;
278
                 return id;
278
             }
279
             }
279
             // The RemoteVideo was removed (but the DOM elements may
280
             // The RemoteVideo was removed (but the DOM elements may
281
         }
282
         }
282
 
283
 
283
         // Go with local video
284
         // Go with local video
284
-        console.info("Fallback to local video...");
285
+        logger.info("Fallback to local video...");
285
 
286
 
286
         let id = APP.conference.getMyUserId();
287
         let id = APP.conference.getMyUserId();
287
-        console.info("electLastVisibleVideo: " + id);
288
+        logger.info("electLastVisibleVideo: " + id);
288
 
289
 
289
         return id;
290
         return id;
290
     },
291
     },
426
     // FIXME: what does this do???
427
     // FIXME: what does this do???
427
     remoteVideoActive(videoElement, resourceJid) {
428
     remoteVideoActive(videoElement, resourceJid) {
428
 
429
 
429
-        console.info(resourceJid + " video is now active", videoElement);
430
+        logger.info(resourceJid + " video is now active", videoElement);
430
 
431
 
431
         VideoLayout.resizeThumbnails(
432
         VideoLayout.resizeThumbnails(
432
             false, false, function() {$(videoElement).show();});
433
             false, false, function() {$(videoElement).show();});
724
             if (resourceJid &&
725
             if (resourceJid &&
725
                 lastNEndpoints.indexOf(resourceJid) < 0 &&
726
                 lastNEndpoints.indexOf(resourceJid) < 0 &&
726
                 localLastNSet.indexOf(resourceJid) < 0) {
727
                 localLastNSet.indexOf(resourceJid) < 0) {
727
-                console.log("Remove from last N", resourceJid);
728
+                logger.log("Remove from last N", resourceJid);
728
                 if (smallVideo)
729
                 if (smallVideo)
729
                     smallVideo.showPeerContainer('hide');
730
                     smallVideo.showPeerContainer('hide');
730
                 else if (!APP.conference.isLocalId(resourceJid))
731
                 else if (!APP.conference.isLocalId(resourceJid))
731
-                    console.error("No remote video for: " + resourceJid);
732
+                    logger.error("No remote video for: " + resourceJid);
732
                 isReceived = false;
733
                 isReceived = false;
733
             } else if (resourceJid &&
734
             } else if (resourceJid &&
734
                 //TOFIX: smallVideo may be undefined
735
                 //TOFIX: smallVideo may be undefined
741
                 if (smallVideo)
742
                 if (smallVideo)
742
                     smallVideo.showPeerContainer('avatar');
743
                     smallVideo.showPeerContainer('avatar');
743
                 else if (!APP.conference.isLocalId(resourceJid))
744
                 else if (!APP.conference.isLocalId(resourceJid))
744
-                    console.error("No remote video for: " + resourceJid);
745
+                    logger.error("No remote video for: " + resourceJid);
745
                 isReceived = false;
746
                 isReceived = false;
746
             }
747
             }
747
 
748
 
768
                     remoteVideo.showPeerContainer('show');
769
                     remoteVideo.showPeerContainer('show');
769
 
770
 
770
                 if (!remoteVideo.isVisible()) {
771
                 if (!remoteVideo.isVisible()) {
771
-                    console.log("Add to last N", resourceJid);
772
+                    logger.log("Add to last N", resourceJid);
772
 
773
 
773
                     remoteVideo.addRemoteStreamElement(remoteVideo.videoStream);
774
                     remoteVideo.addRemoteStreamElement(remoteVideo.videoStream);
774
 
775
 
869
     removeParticipantContainer (id) {
870
     removeParticipantContainer (id) {
870
         // Unlock large video
871
         // Unlock large video
871
         if (pinnedId === id) {
872
         if (pinnedId === id) {
872
-            console.info("Focused video owner has left the conference");
873
+            logger.info("Focused video owner has left the conference");
873
             pinnedId = null;
874
             pinnedId = null;
874
         }
875
         }
875
 
876
 
876
         if (currentDominantSpeaker === id) {
877
         if (currentDominantSpeaker === id) {
877
-            console.info("Dominant speaker has left the conference");
878
+            logger.info("Dominant speaker has left the conference");
878
             currentDominantSpeaker = null;
879
             currentDominantSpeaker = null;
879
         }
880
         }
880
 
881
 
881
         var remoteVideo = remoteVideos[id];
882
         var remoteVideo = remoteVideos[id];
882
         if (remoteVideo) {
883
         if (remoteVideo) {
883
             // Remove remote video
884
             // Remove remote video
884
-            console.info("Removing remote video: " + id);
885
+            logger.info("Removing remote video: " + id);
885
             delete remoteVideos[id];
886
             delete remoteVideos[id];
886
             remoteVideo.remove();
887
             remoteVideo.remove();
887
         } else {
888
         } else {
888
-            console.warn("No remote video for " + id);
889
+            logger.warn("No remote video for " + id);
889
         }
890
         }
890
 
891
 
891
         VideoLayout.resizeThumbnails();
892
         VideoLayout.resizeThumbnails();
896
             return;
897
             return;
897
         }
898
         }
898
 
899
 
899
-        console.info("Peer video type changed: ", id, newVideoType);
900
+        logger.info("Peer video type changed: ", id, newVideoType);
900
 
901
 
901
         var smallVideo;
902
         var smallVideo;
902
         if (APP.conference.isLocalId(id)) {
903
         if (APP.conference.isLocalId(id)) {
903
             if (!localVideoThumbnail) {
904
             if (!localVideoThumbnail) {
904
-                console.warn("Local video not ready yet");
905
+                logger.warn("Local video not ready yet");
905
                 return;
906
                 return;
906
             }
907
             }
907
             smallVideo = localVideoThumbnail;
908
             smallVideo = localVideoThumbnail;
925
             if (remoteVideo) {
926
             if (remoteVideo) {
926
                 remoteVideo.connectionIndicator.showMore();
927
                 remoteVideo.connectionIndicator.showMore();
927
             } else {
928
             } else {
928
-                console.info("Error - no remote video for id: " + id);
929
+                logger.info("Error - no remote video for id: " + id);
929
             }
930
             }
930
         }
931
         }
931
     },
932
     },
982
         if (smallVideo) {
983
         if (smallVideo) {
983
             smallVideo.avatarChanged(avatarUrl);
984
             smallVideo.avatarChanged(avatarUrl);
984
         } else {
985
         } else {
985
-            console.warn(
986
+            logger.warn(
986
                 "Missed avatar update - no small video yet for " + id
987
                 "Missed avatar update - no small video yet for " + id
987
             );
988
             );
988
         }
989
         }

+ 4
- 4
modules/URL/ConferenceUrl.js 查看文件

1
-/* global console */
1
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
2
 
3
 import { redirect } from '../util/helpers';
3
 import { redirect } from '../util/helpers';
4
 
4
 
45
          */
45
          */
46
         this.inviteURL
46
         this.inviteURL
47
             = location.protocol + "//" + location.host + location.pathname;
47
             = location.protocol + "//" + location.host + location.pathname;
48
-        console.info("Stored original conference URL: " + this.originalURL);
49
-        console.info("Conference URL for invites: " + this.inviteURL);
48
+        logger.info("Stored original conference URL: " + this.originalURL);
49
+        logger.info("Conference URL for invites: " + this.inviteURL);
50
     }
50
     }
51
     /**
51
     /**
52
      * Obtains the conference invite URL.
52
      * Obtains the conference invite URL.
67
      * Reloads the conference using original URL with all of the parameters.
67
      * Reloads the conference using original URL with all of the parameters.
68
      */
68
      */
69
     reload() {
69
     reload() {
70
-        console.info("Reloading the conference using URL: " + this.originalURL);
70
+        logger.info("Reloading the conference using URL: " + this.originalURL);
71
         redirect(this.originalURL);
71
         redirect(this.originalURL);
72
     }
72
     }
73
 }
73
 }

+ 5
- 3
modules/config/BoshAddressChoice.js 查看文件

1
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
+
1
 var JSSHA = require('jssha');
3
 var JSSHA = require('jssha');
2
 
4
 
3
 module.exports = {
5
 module.exports = {
22
         var attemptFirstAddress;
24
         var attemptFirstAddress;
23
 
25
 
24
         config.bosh = config.boshList[idx];
26
         config.bosh = config.boshList[idx];
25
-        console.log('Setting config.bosh to ' + config.bosh +
27
+        logger.log('Setting config.bosh to ' + config.bosh +
26
             ' (idx=' + idx + ')');
28
             ' (idx=' + idx + ')');
27
 
29
 
28
         if (config.boshAttemptFirstList &&
30
         if (config.boshAttemptFirstList &&
34
 
36
 
35
             if (attemptFirstAddress != config.bosh) {
37
             if (attemptFirstAddress != config.bosh) {
36
                 config.boshAttemptFirst = attemptFirstAddress;
38
                 config.boshAttemptFirst = attemptFirstAddress;
37
-                console.log('Setting config.boshAttemptFirst=' +
39
+                logger.log('Setting config.boshAttemptFirst=' +
38
                     attemptFirstAddress + ' (idx=' + idx + ')');
40
                     attemptFirstAddress + ' (idx=' + idx + ')');
39
             } else {
41
             } else {
40
-                console.log('Not setting boshAttemptFirst, address matches.');
42
+                logger.log('Not setting boshAttemptFirst, address matches.');
41
             }
43
             }
42
         }
44
         }
43
     }
45
     }

+ 4
- 3
modules/config/HttpConfigFetch.js 查看文件

1
 /* global $, config, interfaceConfig */
1
 /* global $, config, interfaceConfig */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 
3
 
3
 var configUtil = require('./Util');
4
 var configUtil = require('./Util');
4
 
5
 
16
      * @param complete
17
      * @param complete
17
      */
18
      */
18
     obtainConfig: function (endpoint, roomName, complete) {
19
     obtainConfig: function (endpoint, roomName, complete) {
19
-        console.info(
20
+        logger.info(
20
             "Send config request to " + endpoint + " for room: " + roomName);
21
             "Send config request to " + endpoint + " for room: " + roomName);
21
 
22
 
22
 
23
 
28
                 data: JSON.stringify({"roomName": roomName}),
29
                 data: JSON.stringify({"roomName": roomName}),
29
                 dataType: 'json',
30
                 dataType: 'json',
30
                 error: function(jqXHR, textStatus, errorThrown) {
31
                 error: function(jqXHR, textStatus, errorThrown) {
31
-                    console.error("Get config error: ", jqXHR, errorThrown);
32
+                    logger.error("Get config error: ", jqXHR, errorThrown);
32
                     var error = "Get config response status: " + textStatus;
33
                     var error = "Get config response status: " + textStatus;
33
                     complete(false, error);
34
                     complete(false, error);
34
                 },
35
                 },
39
                         complete(true);
40
                         complete(true);
40
                         return;
41
                         return;
41
                     } catch (exception) {
42
                     } catch (exception) {
42
-                        console.error("Parse config error: ", exception);
43
+                        logger.error("Parse config error: ", exception);
43
                         complete(false, exception);
44
                         complete(false, exception);
44
                     }
45
                     }
45
                 }
46
                 }

+ 3
- 1
modules/config/URLProcessor.js 查看文件

1
 /* global config, interfaceConfig, getConfigParamsFromUrl */
1
 /* global config, interfaceConfig, getConfigParamsFromUrl */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 var configUtils = require('./Util');
4
 var configUtils = require('./Util');
3
 var params = {};
5
 var params = {};
4
 
6
 
29
         };
31
         };
30
         for (var key in params) {
32
         for (var key in params) {
31
             if (typeof key !== "string") {
33
             if (typeof key !== "string") {
32
-                console.warn("Invalid config key: ", key);
34
+                logger.warn("Invalid config key: ", key);
33
                 continue;
35
                 continue;
34
             }
36
             }
35
             var confObj = null, confKey;
37
             var confObj = null, confKey;

+ 4
- 2
modules/config/Util.js 查看文件

1
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
+
1
 var ConfigUtil = {
3
 var ConfigUtil = {
2
     /**
4
     /**
3
      * Method overrides JSON properties in <tt>config</tt> and
5
      * Method overrides JSON properties in <tt>config</tt> and
31
             for (key in newConfig[configRoot]) {
33
             for (key in newConfig[configRoot]) {
32
                 value = newConfig[configRoot][key];
34
                 value = newConfig[configRoot][key];
33
                 if (confObj[key] && typeof confObj[key] !== typeof value) {
35
                 if (confObj[key] && typeof confObj[key] !== typeof value) {
34
-                    console.log("Overriding a " + configRoot +
36
+                    logger.log("Overriding a " + configRoot +
35
                         " property with a property of different type.");
37
                         " property with a property of different type.");
36
                 }
38
                 }
37
-                console.info("Overriding " + key + " with: " + value);
39
+                logger.info("Overriding " + key + " with: " + value);
38
                 confObj[key] = value;
40
                 confObj[key] = value;
39
             }
41
             }
40
         }
42
         }

+ 3
- 1
modules/settings/Settings.js 查看文件

1
 /* global JitsiMeetJS */
1
 /* global JitsiMeetJS */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2
 import UIUtil from '../UI/util/UIUtil';
4
 import UIUtil from '../UI/util/UIUtil';
3
 import jitsiLocalStorage from '../util/JitsiLocalStorage';
5
 import jitsiLocalStorage from '../util/JitsiLocalStorage';
4
 
6
 
37
     JitsiMeetJS.mediaDevices.getAudioOutputDevice()) {
39
     JitsiMeetJS.mediaDevices.getAudioOutputDevice()) {
38
     JitsiMeetJS.mediaDevices.setAudioOutputDevice(audioOutputDeviceId)
40
     JitsiMeetJS.mediaDevices.setAudioOutputDevice(audioOutputDeviceId)
39
         .catch((ex) => {
41
         .catch((ex) => {
40
-            console.warn('Failed to set audio output device from local ' +
42
+            logger.warn('Failed to set audio output device from local ' +
41
                 'storage. Default audio output device will be used' +
43
                 'storage. Default audio output device will be used' +
42
                 'instead.', ex);
44
                 'instead.', ex);
43
         });
45
         });

+ 3
- 1
modules/util/helpers.js 查看文件

1
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
+
1
 /**
3
 /**
2
  * Create deferred object.
4
  * Create deferred object.
3
  * @returns {{promise, resolve, reject}}
5
  * @returns {{promise, resolve, reject}}
35
  * @param msg {string} [optional] the message printed in addition to the error
37
  * @param msg {string} [optional] the message printed in addition to the error
36
  */
38
  */
37
 export function reportError (e, msg = "") {
39
 export function reportError (e, msg = "") {
38
-    console.error(msg, e);
40
+    logger.error(msg, e);
39
     if(window.onerror)
41
     if(window.onerror)
40
         window.onerror(msg, null, null,
42
         window.onerror(msg, null, null,
41
             null, e);
43
             null, e);

+ 1
- 0
package.json 查看文件

24
     "haste-resolver-webpack-plugin": "^0.2.2",
24
     "haste-resolver-webpack-plugin": "^0.2.2",
25
     "i18next": "3.4.4",
25
     "i18next": "3.4.4",
26
     "i18next-xhr-backend": "1.1.0",
26
     "i18next-xhr-backend": "1.1.0",
27
+    "jitsi-meet-logger": "jitsi/jitsi-meet-logger",
27
     "jquery": "~2.1.1",
28
     "jquery": "~2.1.1",
28
     "jquery-contextmenu": "*",
29
     "jquery-contextmenu": "*",
29
     "jquery-i18next": "1.1.0",
30
     "jquery-i18next": "1.1.0",

Loading…
取消
儲存