Browse Source

use logger instead of console

master
paweldomas 8 years ago
parent
commit
b58f1cdd16

+ 5
- 4
app.js View File

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

+ 25
- 23
conference.js View File

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

+ 3
- 1
connection.js View File

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

+ 4
- 2
modules/API/API.js View File

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

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

+ 2
- 1
modules/FollowMe.js View File

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

+ 5
- 3
modules/UI/UI.js View File

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

+ 8
- 7
modules/UI/authentication/AuthHandler.js View File

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

+ 2
- 1
modules/UI/avatar/Avatar.js View File

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

+ 2
- 1
modules/UI/invite/Invite.js View File

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

+ 2
- 1
modules/UI/invite/InviteDialogView.js View File

@@ -1,4 +1,5 @@
1 1
 /* global $, APP, JitsiMeetJS */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2 3
 
3 4
 /**
4 5
  * Substate for password
@@ -312,7 +313,7 @@ export default class InviteDialogView {
312 313
                     this.blur();
313 314
                 }
314 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 View File

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

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

+ 2
- 1
modules/UI/reload_overlay/PageReloadOverlay.js View File

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

+ 8
- 7
modules/UI/shared_video/SharedVideo.js View File

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

+ 3
- 1
modules/UI/side_pannels/contactlist/ContactListView.js View File

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

+ 3
- 2
modules/UI/util/MessageHandler.js View File

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

+ 2
- 1
modules/UI/videolayout/LargeVideoManager.js View File

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

+ 3
- 1
modules/UI/videolayout/LocalVideo.js View File

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

+ 6
- 5
modules/UI/videolayout/RemoteVideo.js View File

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

+ 5
- 3
modules/UI/videolayout/SmallVideo.js View File

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

+ 19
- 18
modules/UI/videolayout/VideoLayout.js View File

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

+ 4
- 4
modules/URL/ConferenceUrl.js View File

@@ -1,4 +1,4 @@
1
-/* global console */
1
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2 2
 
3 3
 import { redirect } from '../util/helpers';
4 4
 
@@ -45,8 +45,8 @@ export default class ConferenceUrl {
45 45
          */
46 46
         this.inviteURL
47 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 52
      * Obtains the conference invite URL.
@@ -67,7 +67,7 @@ export default class ConferenceUrl {
67 67
      * Reloads the conference using original URL with all of the parameters.
68 68
      */
69 69
     reload() {
70
-        console.info("Reloading the conference using URL: " + this.originalURL);
70
+        logger.info("Reloading the conference using URL: " + this.originalURL);
71 71
         redirect(this.originalURL);
72 72
     }
73 73
 }

+ 5
- 3
modules/config/BoshAddressChoice.js View File

@@ -1,3 +1,5 @@
1
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
+
1 3
 var JSSHA = require('jssha');
2 4
 
3 5
 module.exports = {
@@ -22,7 +24,7 @@ module.exports = {
22 24
         var attemptFirstAddress;
23 25
 
24 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 28
             ' (idx=' + idx + ')');
27 29
 
28 30
         if (config.boshAttemptFirstList &&
@@ -34,10 +36,10 @@ module.exports = {
34 36
 
35 37
             if (attemptFirstAddress != config.bosh) {
36 38
                 config.boshAttemptFirst = attemptFirstAddress;
37
-                console.log('Setting config.boshAttemptFirst=' +
39
+                logger.log('Setting config.boshAttemptFirst=' +
38 40
                     attemptFirstAddress + ' (idx=' + idx + ')');
39 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 View File

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

+ 3
- 1
modules/config/URLProcessor.js View File

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

+ 4
- 2
modules/config/Util.js View File

@@ -1,3 +1,5 @@
1
+const logger = require("jitsi-meet-logger").getLogger(__filename);
2
+
1 3
 var ConfigUtil = {
2 4
     /**
3 5
      * Method overrides JSON properties in <tt>config</tt> and
@@ -31,10 +33,10 @@ var ConfigUtil = {
31 33
             for (key in newConfig[configRoot]) {
32 34
                 value = newConfig[configRoot][key];
33 35
                 if (confObj[key] && typeof confObj[key] !== typeof value) {
34
-                    console.log("Overriding a " + configRoot +
36
+                    logger.log("Overriding a " + configRoot +
35 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 40
                 confObj[key] = value;
39 41
             }
40 42
         }

+ 3
- 1
modules/settings/Settings.js View File

@@ -1,4 +1,6 @@
1 1
 /* global JitsiMeetJS */
2
+const logger = require("jitsi-meet-logger").getLogger(__filename);
3
+
2 4
 import UIUtil from '../UI/util/UIUtil';
3 5
 import jitsiLocalStorage from '../util/JitsiLocalStorage';
4 6
 
@@ -37,7 +39,7 @@ if (audioOutputDeviceId !==
37 39
     JitsiMeetJS.mediaDevices.getAudioOutputDevice()) {
38 40
     JitsiMeetJS.mediaDevices.setAudioOutputDevice(audioOutputDeviceId)
39 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 43
                 'storage. Default audio output device will be used' +
42 44
                 'instead.', ex);
43 45
         });

+ 3
- 1
modules/util/helpers.js View File

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

+ 1
- 0
package.json View File

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

Loading…
Cancel
Save