use logger instead of console

This commit is contained in:
paweldomas 2016-11-11 09:00:54 -06:00
parent 71c27f308c
commit b58f1cdd16
30 changed files with 152 additions and 108 deletions

9
app.js
View File

@ -1,5 +1,6 @@
/* global $, config, getRoomName */ /* global $, config, getRoomName */
/* application specific logic */ /* application specific logic */
const logger = require("jitsi-meet-logger").getLogger(__filename);
import "babel-polyfill"; import "babel-polyfill";
import "jquery"; import "jquery";
@ -42,7 +43,7 @@ function pushHistoryState(roomName, URL) {
'VideoChat', `Room: ${roomName}`, URL 'VideoChat', `Room: ${roomName}`, URL
); );
} catch (e) { } catch (e) {
console.warn("Push history state failed with parameters:", logger.warn("Push history state failed with parameters:",
'VideoChat', `Room: ${roomName}`, URL, e); 'VideoChat', `Room: ${roomName}`, URL, e);
return e; return e;
} }
@ -145,7 +146,7 @@ function init() {
}).catch(function (err) { }).catch(function (err) {
APP.UI.hideRingOverLay(); APP.UI.hideRingOverLay();
APP.API.notifyConferenceLeft(APP.conference.roomName); APP.API.notifyConferenceLeft(APP.conference.roomName);
console.error(err); logger.error(err);
}); });
} }
} }
@ -169,7 +170,7 @@ function obtainConfigAndInit() {
if (success) { if (success) {
var now = APP.connectionTimes["configuration.fetched"] = var now = APP.connectionTimes["configuration.fetched"] =
window.performance.now(); window.performance.now();
console.log("(TIME) configuration fetched:\t", now); logger.log("(TIME) configuration fetched:\t", now);
init(); init();
} else { } else {
// Show obtain config error, // Show obtain config error,
@ -189,7 +190,7 @@ function obtainConfigAndInit() {
$(document).ready(function () { $(document).ready(function () {
var now = APP.connectionTimes["document.ready"] = window.performance.now(); var now = APP.connectionTimes["document.ready"] = window.performance.now();
console.log("(TIME) document ready:\t", now); logger.log("(TIME) document ready:\t", now);
URLProcessor.setConfigParametersFromUrl(); URLProcessor.setConfigParametersFromUrl();
APP.init(); APP.init();

View File

@ -1,4 +1,6 @@
/* global $, APP, JitsiMeetJS, config, interfaceConfig */ /* global $, APP, JitsiMeetJS, config, interfaceConfig */
const logger = require("jitsi-meet-logger").getLogger(__filename);
import {openConnection} from './connection'; import {openConnection} from './connection';
import Invite from './modules/UI/invite/Invite'; import Invite from './modules/UI/invite/Invite';
import ContactList from './modules/UI/side_pannels/contactlist/ContactList'; import ContactList from './modules/UI/side_pannels/contactlist/ContactList';
@ -166,7 +168,7 @@ function muteLocalMedia(localMedia, muted, localMediaTypeString) {
const method = muted ? 'mute' : 'unmute'; const method = muted ? 'mute' : 'unmute';
localMedia[method]().catch(reason => { localMedia[method]().catch(reason => {
console.warn(`${localMediaTypeString} ${method} was rejected:`, reason); logger.warn(`${localMediaTypeString} ${method} was rejected:`, reason);
}); });
} }
@ -254,7 +256,7 @@ function createLocalTracks (options, checkForPermissionPrompt) {
}); });
return tracks; return tracks;
}).catch(function (err) { }).catch(function (err) {
console.error( logger.error(
'failed to create local tracks', options.devices, err); 'failed to create local tracks', options.devices, err);
return Promise.reject(err); return Promise.reject(err);
}); });
@ -310,7 +312,7 @@ class ConferenceConnector {
this._reject(err); this._reject(err);
} }
_onConferenceFailed(err, ...params) { _onConferenceFailed(err, ...params) {
console.error('CONFERENCE FAILED:', err, ...params); logger.error('CONFERENCE FAILED:', err, ...params);
APP.UI.hideRingOverLay(); APP.UI.hideRingOverLay();
switch (err) { switch (err) {
// room is locked by the password // room is locked by the password
@ -398,7 +400,7 @@ class ConferenceConnector {
} }
} }
_onConferenceError(err, ...params) { _onConferenceError(err, ...params) {
console.error('CONFERENCE Error:', err, params); logger.error('CONFERENCE Error:', err, params);
switch (err) { switch (err) {
case ConferenceErrors.CHAT_ERROR: case ConferenceErrors.CHAT_ERROR:
{ {
@ -407,7 +409,7 @@ class ConferenceConnector {
} }
break; break;
default: default:
console.error("Unknown error."); logger.error("Unknown error.", err);
} }
} }
_unsubscribe() { _unsubscribe() {
@ -493,7 +495,7 @@ export default {
analytics.init(); analytics.init();
return createInitialLocalTracksAndConnect(options.roomName); return createInitialLocalTracksAndConnect(options.roomName);
}).then(([tracks, con]) => { }).then(([tracks, con]) => {
console.log('initialized with %s local tracks', tracks.length); logger.log('initialized with %s local tracks', tracks.length);
APP.connection = connection = con; APP.connection = connection = con;
this._bindConnectionFailedHandler(con); this._bindConnectionFailedHandler(con);
this._createRoom(tracks); this._createRoom(tracks);
@ -546,7 +548,7 @@ export default {
// - item-not-found // - item-not-found
// - connection dropped(closed by Strophe unexpectedly // - connection dropped(closed by Strophe unexpectedly
// possible due too many transport errors) // possible due too many transport errors)
console.error("XMPP connection error: " + errMsg); logger.error("XMPP connection error: " + errMsg);
APP.UI.showPageReloadOverlay(); APP.UI.showPageReloadOverlay();
connection.removeEventListener( connection.removeEventListener(
ConnectionEvents.CONNECTION_FAILED, handler); ConnectionEvents.CONNECTION_FAILED, handler);
@ -876,7 +878,7 @@ export default {
} else if (track.isVideoTrack()) { } else if (track.isVideoTrack()) {
return this.useVideoStream(track); return this.useVideoStream(track);
} else { } else {
console.error( logger.error(
"Ignored not an audio nor a video track: ", track); "Ignored not an audio nor a video track: ", track);
return Promise.resolve(); return Promise.resolve();
} }
@ -968,11 +970,11 @@ export default {
videoSwitchInProgress: false, videoSwitchInProgress: false,
toggleScreenSharing (shareScreen = !this.isSharingScreen) { toggleScreenSharing (shareScreen = !this.isSharingScreen) {
if (this.videoSwitchInProgress) { if (this.videoSwitchInProgress) {
console.warn("Switch in progress."); logger.warn("Switch in progress.");
return; return;
} }
if (!this.isDesktopSharingEnabled) { if (!this.isDesktopSharingEnabled) {
console.warn("Cannot toggle screen sharing: not supported."); logger.warn("Cannot toggle screen sharing: not supported.");
return; return;
} }
@ -1026,7 +1028,7 @@ export default {
this.videoSwitchInProgress = false; this.videoSwitchInProgress = false;
JitsiMeetJS.analytics.sendEvent( JitsiMeetJS.analytics.sendEvent(
'conference.sharingDesktop.start'); 'conference.sharingDesktop.start');
console.log('sharing local desktop'); logger.log('sharing local desktop');
}).catch((err) => { }).catch((err) => {
// close external installation dialog to show the error. // close external installation dialog to show the error.
if(externalInstallation) if(externalInstallation)
@ -1038,7 +1040,7 @@ export default {
return; return;
} }
console.error('failed to share local desktop', err); logger.error('failed to share local desktop', err);
if (err.name === TrackErrors.FIREFOX_EXTENSION_NEEDED) { if (err.name === TrackErrors.FIREFOX_EXTENSION_NEEDED) {
APP.UI.showExtensionRequiredDialog( APP.UI.showExtensionRequiredDialog(
@ -1075,11 +1077,11 @@ export default {
this.videoSwitchInProgress = false; this.videoSwitchInProgress = false;
JitsiMeetJS.analytics.sendEvent( JitsiMeetJS.analytics.sendEvent(
'conference.sharingDesktop.stop'); 'conference.sharingDesktop.stop');
console.log('sharing local video'); logger.log('sharing local video');
}).catch((err) => { }).catch((err) => {
this.useVideoStream(null); this.useVideoStream(null);
this.videoSwitchInProgress = false; this.videoSwitchInProgress = false;
console.error('failed to share local video', err); logger.error('failed to share local video', err);
}); });
} }
}, },
@ -1105,7 +1107,7 @@ export default {
if (user.isHidden()) if (user.isHidden())
return; return;
console.log('USER %s connnected', id, user); logger.log('USER %s connnected', id, user);
APP.API.notifyUserJoined(id); APP.API.notifyUserJoined(id);
APP.UI.addUser(user); APP.UI.addUser(user);
@ -1113,7 +1115,7 @@ export default {
APP.UI.updateUserRole(user); APP.UI.updateUserRole(user);
}); });
room.on(ConferenceEvents.USER_LEFT, (id, user) => { room.on(ConferenceEvents.USER_LEFT, (id, user) => {
console.log('USER %s LEFT', id, user); logger.log('USER %s LEFT', id, user);
APP.API.notifyUserLeft(id); APP.API.notifyUserLeft(id);
APP.UI.removeUser(id, user.getDisplayName()); APP.UI.removeUser(id, user.getDisplayName());
APP.UI.onSharedVideoStop(id); APP.UI.onSharedVideoStop(id);
@ -1122,7 +1124,7 @@ export default {
room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => { room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => {
if (this.isLocalId(id)) { if (this.isLocalId(id)) {
console.info(`My role changed, new role: ${role}`); logger.info(`My role changed, new role: ${role}`);
if (this.isModerator !== room.isModerator()) { if (this.isModerator !== room.isModerator()) {
this.isModerator = room.isModerator(); this.isModerator = room.isModerator();
APP.UI.updateLocalRole(room.isModerator()); APP.UI.updateLocalRole(room.isModerator());
@ -1180,7 +1182,7 @@ export default {
{ {
this.audioLevelsMap[id] = lvl; this.audioLevelsMap[id] = lvl;
if(config.debugAudioLevels) if(config.debugAudioLevels)
console.log("AudioLevel:" + id + "/" + lvl); logger.log("AudioLevel:" + id + "/" + lvl);
} }
APP.UI.setAudioLevel(id, lvl); APP.UI.setAudioLevel(id, lvl);
@ -1261,7 +1263,7 @@ export default {
}); });
room.on(ConferenceEvents.RECORDER_STATE_CHANGED, (status, error) => { room.on(ConferenceEvents.RECORDER_STATE_CHANGED, (status, error) => {
console.log("Received recorder status change: ", status, error); logger.log("Received recorder status change: ", status, error);
APP.UI.updateRecordingState(status); APP.UI.updateRecordingState(status);
}); });
@ -1497,7 +1499,7 @@ export default {
}) })
.then(([stream]) => { .then(([stream]) => {
this.useVideoStream(stream); this.useVideoStream(stream);
console.log('switched local video device'); logger.log('switched local video device');
APP.settings.setCameraDeviceId(cameraDeviceId, true); APP.settings.setCameraDeviceId(cameraDeviceId, true);
}) })
.catch((err) => { .catch((err) => {
@ -1519,7 +1521,7 @@ export default {
}) })
.then(([stream]) => { .then(([stream]) => {
this.useAudioStream(stream); this.useAudioStream(stream);
console.log('switched local audio device'); logger.log('switched local audio device');
APP.settings.setMicDeviceId(micDeviceId, true); APP.settings.setMicDeviceId(micDeviceId, true);
}) })
.catch((err) => { .catch((err) => {
@ -1535,9 +1537,9 @@ export default {
JitsiMeetJS.analytics.sendEvent( JitsiMeetJS.analytics.sendEvent(
'settings.changeDevice.audioOut'); 'settings.changeDevice.audioOut');
APP.settings.setAudioOutputDeviceId(audioOutputDeviceId) APP.settings.setAudioOutputDeviceId(audioOutputDeviceId)
.then(() => console.log('changed audio output device')) .then(() => logger.log('changed audio output device'))
.catch((err) => { .catch((err) => {
console.warn('Failed to change audio output device. ' + logger.warn('Failed to change audio output device. ' +
'Default or previously set audio output device ' + 'Default or previously set audio output device ' +
'will be used instead.', err); 'will be used instead.', err);
APP.UI.setSelectedAudioOutputFromSettings(); APP.UI.setSelectedAudioOutputFromSettings();

View File

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

View File

@ -1,4 +1,6 @@
/* global APP, getConfigParamsFromUrl */ /* global APP, getConfigParamsFromUrl */
const logger = require("jitsi-meet-logger").getLogger(__filename);
/** /**
* Implements API class that communicates with external api class * Implements API class that communicates with external api class
* and provides interface to access Jitsi Meet features by external * and provides interface to access Jitsi Meet features by external
@ -131,13 +133,13 @@ function onSystemMessage(message) {
switch (message.type) { switch (message.type) {
case "eventStatus": case "eventStatus":
if(!message.name || !message.value) { if(!message.name || !message.value) {
console.warn("Unknown system message format", message); logger.warn("Unknown system message format", message);
break; break;
} }
events[message.name] = message.value; events[message.name] = message.value;
break; break;
default: default:
console.warn("Unknown system message type", message); logger.warn("Unknown system message type", message);
} }
} }

View File

@ -1,3 +1,5 @@
const logger = require("jitsi-meet-logger").getLogger(__filename);
/** /**
* Implements API class that embeds Jitsi Meet in external applications. * Implements API class that embeds Jitsi Meet in external applications.
*/ */
@ -72,7 +74,7 @@ function sendMessage(postis, object) {
*/ */
function changeEventStatus(postis, event, status) { function changeEventStatus(postis, event, status) {
if(!(event in events)) { if(!(event in events)) {
console.error("Not supported event name."); logger.error("Not supported event name.");
return; return;
} }
sendMessage(postis, { sendMessage(postis, {
@ -174,7 +176,7 @@ function JitsiMeetExternalAPI(domain, room_name, width, height, parentNode,
*/ */
JitsiMeetExternalAPI.prototype.executeCommand = function(name, argumentsList) { JitsiMeetExternalAPI.prototype.executeCommand = function(name, argumentsList) {
if(!(name in commands)) { if(!(name in commands)) {
console.error("Not supported command name."); logger.error("Not supported command name.");
return; return;
} }
var argumentsArray = argumentsList; var argumentsArray = argumentsList;
@ -306,7 +308,7 @@ JitsiMeetExternalAPI.prototype.addEventListeners = function(object) {
*/ */
JitsiMeetExternalAPI.prototype.addEventListener = function(event, listener) { JitsiMeetExternalAPI.prototype.addEventListener = function(event, listener) {
if(!(event in events)) { if(!(event in events)) {
console.error("Not supported event name."); logger.error("Not supported event name.");
return; return;
} }
// We cannot remove listeners from postis that's why we are handling the // We cannot remove listeners from postis that's why we are handling the
@ -328,7 +330,7 @@ JitsiMeetExternalAPI.prototype.addEventListener = function(event, listener) {
JitsiMeetExternalAPI.prototype.removeEventListener = function(event) { JitsiMeetExternalAPI.prototype.removeEventListener = function(event) {
if(!(event in this.eventHandlers)) if(!(event in this.eventHandlers))
{ {
console.error("The event " + event + " is not registered."); logger.error("The event " + event + " is not registered.");
return; return;
} }
delete this.eventHandlers[event]; delete this.eventHandlers[event];

View File

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

View File

@ -1,4 +1,6 @@
/* global APP, JitsiMeetJS, $, config, interfaceConfig, toastr */ /* global APP, JitsiMeetJS, $, config, interfaceConfig, toastr */
const logger = require("jitsi-meet-logger").getLogger(__filename);
var UI = {}; var UI = {};
import Chat from "./side_pannels/chat/Chat"; import Chat from "./side_pannels/chat/Chat";
@ -501,7 +503,7 @@ UI.addLocalStream = function (track) {
VideoLayout.changeLocalVideo(track); VideoLayout.changeLocalVideo(track);
break; break;
default: default:
console.error("Unknown stream type: " + track.getType()); logger.error("Unknown stream type: " + track.getType());
break; break;
} }
}; };
@ -539,7 +541,7 @@ UI.initEtherpad = function (name) {
if (etherpadManager || !config.etherpad_base || !name) { if (etherpadManager || !config.etherpad_base || !name) {
return; return;
} }
console.log('Etherpad is enabled'); logger.log('Etherpad is enabled');
etherpadManager etherpadManager
= new EtherpadManager(config.etherpad_base, name, eventEmitter); = new EtherpadManager(config.etherpad_base, name, eventEmitter);
Toolbar.showEtherpadButton(); Toolbar.showEtherpadButton();
@ -737,7 +739,7 @@ UI.connectionIndicatorShowMore = function(id) {
// FIXME check if someone user this // FIXME check if someone user this
UI.showLoginPopup = function(callback) { UI.showLoginPopup = function(callback) {
console.log('password is required'); logger.log('password is required');
let message = ( let message = (
`<input name="username" type="text" `<input name="username" type="text"

View File

@ -1,4 +1,5 @@
/* global APP, config, JitsiMeetJS, Promise */ /* global APP, config, JitsiMeetJS, Promise */
const logger = require("jitsi-meet-logger").getLogger(__filename);
import LoginDialog from './LoginDialog'; import LoginDialog from './LoginDialog';
import UIUtil from '../util/UIUtil'; import UIUtil from '../util/UIUtil';
@ -74,13 +75,13 @@ function redirectToTokenAuthService(roomName) {
function initJWTTokenListener(room) { function initJWTTokenListener(room) {
var listener = function (event) { var listener = function (event) {
if (externalAuthWindow !== event.source) { if (externalAuthWindow !== event.source) {
console.warn("Ignored message not coming " + logger.warn("Ignored message not coming " +
"from external authnetication window"); "from external authnetication window");
return; return;
} }
if (event.data && event.data.jwtToken) { if (event.data && event.data.jwtToken) {
config.token = event.data.jwtToken; config.token = event.data.jwtToken;
console.info("Received JWT token:", config.token); logger.info("Received JWT token:", config.token);
var roomName = room.getName(); var roomName = room.getName();
openConnection({retry: false, roomName: roomName }) openConnection({retry: false, roomName: roomName })
.then(function (connection) { .then(function (connection) {
@ -97,10 +98,10 @@ function initJWTTokenListener(room) {
// to upgrade user's role // to upgrade user's role
room.room.moderator.authenticate() room.room.moderator.authenticate()
.then(function () { .then(function () {
console.info("User role upgrade done !"); logger.info("User role upgrade done !");
unregister(); unregister();
}).catch(function (err, errCode) { }).catch(function (err, errCode) {
console.error( logger.error(
"Authentication failed: ", err, errCode); "Authentication failed: ", err, errCode);
unregister(); unregister();
} }
@ -108,13 +109,13 @@ function initJWTTokenListener(room) {
}).catch(function (error, code) { }).catch(function (error, code) {
unregister(); unregister();
connection.disconnect(); connection.disconnect();
console.error( logger.error(
'Authentication failed on the new connection', 'Authentication failed on the new connection',
error, code); error, code);
}); });
}, function (err) { }, function (err) {
unregister(); unregister();
console.error("Failed to open new connection", err); logger.error("Failed to open new connection", err);
}); });
} }
}; };
@ -161,7 +162,7 @@ function doXmppAuth (room, lockPassword) {
}).catch(function (error, code) { }).catch(function (error, code) {
connection.disconnect(); connection.disconnect();
console.error('Auth on the fly failed', error); logger.error('Auth on the fly failed', error);
loginDialog.displayError( loginDialog.displayError(
'connection.GET_SESSION_ID_ERROR', {code: code}); 'connection.GET_SESSION_ID_ERROR', {code: code});

View File

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

View File

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

View File

@ -1,4 +1,5 @@
/* global $, APP, JitsiMeetJS */ /* global $, APP, JitsiMeetJS */
const logger = require("jitsi-meet-logger").getLogger(__filename);
/** /**
* Substate for password * Substate for password
@ -312,7 +313,7 @@ export default class InviteDialogView {
this.blur(); this.blur();
} }
catch (err) { catch (err) {
console.error('error when copy the text'); logger.error('error when copy the text');
} }
} }
}); });

View File

@ -1,4 +1,6 @@
/* global APP, JitsiMeetJS */ /* global APP, JitsiMeetJS */
const logger = require("jitsi-meet-logger").getLogger(__filename);
import RequirePasswordDialog from './RequirePasswordDialog'; import RequirePasswordDialog from './RequirePasswordDialog';
/** /**
@ -6,7 +8,7 @@ import RequirePasswordDialog from './RequirePasswordDialog';
* because server doesn't support that. * because server doesn't support that.
*/ */
function notifyPasswordNotSupported () { function notifyPasswordNotSupported () {
console.warn('room passwords not supported'); logger.warn('room passwords not supported');
APP.UI.messageHandler.showError( APP.UI.messageHandler.showError(
"dialog.warning", "dialog.passwordNotSupported"); "dialog.warning", "dialog.passwordNotSupported");
} }
@ -16,7 +18,7 @@ function notifyPasswordNotSupported () {
* @param {Error} err error * @param {Error} err error
*/ */
function notifyPasswordFailed(err) { function notifyPasswordFailed(err) {
console.warn('setting password failed', err); logger.warn('setting password failed', err);
APP.UI.messageHandler.showError( APP.UI.messageHandler.showError(
"dialog.lockTitle", "dialog.lockMessage"); "dialog.lockTitle", "dialog.lockMessage");
} }
@ -64,7 +66,7 @@ export default function createRoomLocker (room) {
if (!password) if (!password)
lockedElsewhere = false; lockedElsewhere = false;
}).catch(function (err) { }).catch(function (err) {
console.error(err); logger.error(err);
if (err === ConferenceErrors.PASSWORD_NOT_SUPPORTED) { if (err === ConferenceErrors.PASSWORD_NOT_SUPPORTED) {
notifyPasswordNotSupported(); notifyPasswordNotSupported();
} else { } else {
@ -113,7 +115,7 @@ export default function createRoomLocker (room) {
// pass stays between attempts // pass stays between attempts
password = null; password = null;
if (reason !== APP.UI.messageHandler.CANCEL) if (reason !== APP.UI.messageHandler.CANCEL)
console.error(reason); logger.error(reason);
} }
); );
}, },

View File

@ -14,6 +14,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
const logger = require("jitsi-meet-logger").getLogger(__filename);
import UIEvents from "../../../service/UI/UIEvents"; import UIEvents from "../../../service/UI/UIEvents";
import UIUtil from '../util/UIUtil'; import UIUtil from '../util/UIUtil';
import VideoLayout from '../videolayout/VideoLayout'; import VideoLayout from '../videolayout/VideoLayout';
@ -327,7 +329,7 @@ var Recording = {
}).catch( }).catch(
reason => { reason => {
if (reason !== APP.UI.messageHandler.CANCEL) if (reason !== APP.UI.messageHandler.CANCEL)
console.error(reason); logger.error(reason);
else else
JitsiMeetJS.analytics.sendEvent( JitsiMeetJS.analytics.sendEvent(
'recording.canceled'); 'recording.canceled');
@ -350,7 +352,7 @@ var Recording = {
}).catch( }).catch(
reason => { reason => {
if (reason !== APP.UI.messageHandler.CANCEL) if (reason !== APP.UI.messageHandler.CANCEL)
console.error(reason); logger.error(reason);
else else
JitsiMeetJS.analytics.sendEvent( JitsiMeetJS.analytics.sendEvent(
'recording.canceled'); 'recording.canceled');

View File

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

View File

@ -1,5 +1,6 @@
/* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError, /* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError,
JitsiMeetJS */ JitsiMeetJS */
const logger = require("jitsi-meet-logger").getLogger(__filename);
import UIUtil from '../util/UIUtil'; import UIUtil from '../util/UIUtil';
import UIEvents from '../../../service/UI/UIEvents'; import UIEvents from '../../../service/UI/UIEvents';
@ -75,7 +76,7 @@ export default class SharedVideoManager {
JitsiMeetJS.analytics.sendEvent('sharedvideo.started'); JitsiMeetJS.analytics.sendEvent('sharedvideo.started');
}, },
err => { err => {
console.log('SHARED VIDEO CANCELED', err); logger.log('SHARED VIDEO CANCELED', err);
JitsiMeetJS.analytics.sendEvent('sharedvideo.canceled'); JitsiMeetJS.analytics.sendEvent('sharedvideo.canceled');
} }
); );
@ -277,7 +278,7 @@ export default class SharedVideoManager {
}; };
window.onPlayerError = function(event) { window.onPlayerError = function(event) {
console.error("Error in the player:", event.data); logger.error("Error in the player:", event.data);
// store the error player, so we can remove it // store the error player, so we can remove it
self.errorInPlayer = event.target; self.errorInPlayer = event.target;
}; };
@ -313,7 +314,7 @@ export default class SharedVideoManager {
&& player.getVolume() != attributes.volume) { && player.getVolume() != attributes.volume) {
player.setVolume(attributes.volume); player.setVolume(attributes.volume);
console.info("Player change of volume:" + attributes.volume); logger.info("Player change of volume:" + attributes.volume);
this.showSharedVideoMutedPopup(false); this.showSharedVideoMutedPopup(false);
} }
@ -337,7 +338,7 @@ export default class SharedVideoManager {
processTime (player, attributes, forceSeek) processTime (player, attributes, forceSeek)
{ {
if(forceSeek) { if(forceSeek) {
console.info("Player seekTo:", attributes.time); logger.info("Player seekTo:", attributes.time);
player.seekTo(attributes.time); player.seekTo(attributes.time);
return; return;
} }
@ -349,7 +350,7 @@ export default class SharedVideoManager {
// if we drift more than the interval for checking // if we drift more than the interval for checking
// sync, the interval is in milliseconds // sync, the interval is in milliseconds
if(diff > updateInterval/1000) { if(diff > updateInterval/1000) {
console.info("Player seekTo:", attributes.time, logger.info("Player seekTo:", attributes.time,
" current time is:", currentPosition, " diff:", diff); " current time is:", currentPosition, " diff:", diff);
player.seekTo(attributes.time); player.seekTo(attributes.time);
} }
@ -669,7 +670,7 @@ SharedVideoThumb.prototype.videoClick = function () {
* Removes RemoteVideo from the page. * Removes RemoteVideo from the page.
*/ */
SharedVideoThumb.prototype.remove = function () { SharedVideoThumb.prototype.remove = function () {
console.log("Remove shared video thumb", this.id); logger.log("Remove shared video thumb", this.id);
// Make sure that the large video is updated if are removing its // Make sure that the large video is updated if are removing its
// corresponding small video. // corresponding small video.
@ -686,7 +687,7 @@ SharedVideoThumb.prototype.remove = function () {
*/ */
SharedVideoThumb.prototype.setDisplayName = function(displayName) { SharedVideoThumb.prototype.setDisplayName = function(displayName) {
if (!this.container) { if (!this.container) {
console.warn( "Unable to set displayName - " + this.videoSpanId + logger.warn( "Unable to set displayName - " + this.videoSpanId +
" does not exist"); " does not exist");
return; return;
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,5 @@
/* global $, APP, interfaceConfig */ /* global $, APP, interfaceConfig */
const logger = require("jitsi-meet-logger").getLogger(__filename);
import ConnectionIndicator from './ConnectionIndicator'; import ConnectionIndicator from './ConnectionIndicator';
@ -191,7 +192,7 @@ RemoteVideo.prototype._muteHandler = function () {
} }
}).catch(e => { }).catch(e => {
//currently shouldn't be called //currently shouldn't be called
console.error(e); logger.error(e);
}); });
this.popover.forceHide(); this.popover.forceHide();
@ -343,7 +344,7 @@ RemoteVideo.prototype.removeRemoteStreamElement = function (stream) {
this.wasVideoPlayed = false; this.wasVideoPlayed = false;
} }
console.info((isVideo ? "Video" : "Audio") + logger.info((isVideo ? "Video" : "Audio") +
" removed " + this.id, select); " removed " + this.id, select);
// when removing only the video element and we are on stage // when removing only the video element and we are on stage
@ -408,7 +409,7 @@ RemoteVideo.prototype.updateConnectionStatusIndicator = function (isActive) {
} }
} }
console.debug(this.id + " thumbnail is connection active ? " + isActive); logger.debug(this.id + " thumbnail is connection active ? " + isActive);
// Update 'mutedWhileDisconnected' flag // Update 'mutedWhileDisconnected' flag
this._figureOutMutedWhileDisconnected(!isActive); this._figureOutMutedWhileDisconnected(!isActive);
@ -427,7 +428,7 @@ RemoteVideo.prototype.updateConnectionStatusIndicator = function (isActive) {
* Removes RemoteVideo from the page. * Removes RemoteVideo from the page.
*/ */
RemoteVideo.prototype.remove = function () { RemoteVideo.prototype.remove = function () {
console.log("Remove thumbnail", this.id); logger.log("Remove thumbnail", this.id);
this.removeConnectionIndicator(); this.removeConnectionIndicator();
// Make sure that the large video is updated if are removing its // Make sure that the large video is updated if are removing its
// corresponding small video. // corresponding small video.
@ -586,7 +587,7 @@ RemoteVideo.prototype.hideConnectionIndicator = function () {
*/ */
RemoteVideo.prototype.setDisplayName = function(displayName) { RemoteVideo.prototype.setDisplayName = function(displayName) {
if (!this.container) { if (!this.container) {
console.warn( "Unable to set displayName - " + this.videoSpanId + logger.warn( "Unable to set displayName - " + this.videoSpanId +
" does not exist"); " does not exist");
return; return;
} }

View File

@ -1,4 +1,6 @@
/* global $, JitsiMeetJS, interfaceConfig */ /* global $, JitsiMeetJS, interfaceConfig */
const logger = require("jitsi-meet-logger").getLogger(__filename);
import Avatar from "../avatar/Avatar"; import Avatar from "../avatar/Avatar";
import UIUtil from "../util/UIUtil"; import UIUtil from "../util/UIUtil";
import UIEvents from "../../../service/UI/UIEvents"; import UIEvents from "../../../service/UI/UIEvents";
@ -503,7 +505,7 @@ SmallVideo.prototype.updateView = function () {
// Init avatar // Init avatar
this.avatarChanged(Avatar.getAvatarUrl(this.id)); this.avatarChanged(Avatar.getAvatarUrl(this.id));
} else { } else {
console.error("Unable to init avatar - no id", this); logger.error("Unable to init avatar - no id", this);
return; return;
} }
} }
@ -561,7 +563,7 @@ SmallVideo.prototype.showDominantSpeakerIndicator = function (show) {
return; return;
if (!this.container) { if (!this.container) {
console.warn( "Unable to set dominant speaker indicator - " logger.warn( "Unable to set dominant speaker indicator - "
+ this.videoSpanId + " does not exist"); + this.videoSpanId + " does not exist");
return; return;
} }
@ -589,7 +591,7 @@ SmallVideo.prototype.showDominantSpeakerIndicator = function (show) {
*/ */
SmallVideo.prototype.showRaisedHandIndicator = function (show) { SmallVideo.prototype.showRaisedHandIndicator = function (show) {
if (!this.container) { if (!this.container) {
console.warn( "Unable to raised hand indication - " logger.warn( "Unable to raised hand indication - "
+ this.videoSpanId + " does not exist"); + this.videoSpanId + " does not exist");
return; return;
} }

View File

@ -1,4 +1,5 @@
/* global config, APP, $, interfaceConfig */ /* global config, APP, $, interfaceConfig */
const logger = require("jitsi-meet-logger").getLogger(__filename);
import FilmStrip from "./FilmStrip"; import FilmStrip from "./FilmStrip";
import UIEvents from "../../../service/UI/UIEvents"; import UIEvents from "../../../service/UI/UIEvents";
@ -261,19 +262,19 @@ var VideoLayout = {
if (lastVisible.length) { if (lastVisible.length) {
let id = getPeerContainerResourceId(lastVisible[0]); let id = getPeerContainerResourceId(lastVisible[0]);
if (remoteVideos[id]) { if (remoteVideos[id]) {
console.info("electLastVisibleVideo: " + id); logger.info("electLastVisibleVideo: " + id);
return id; return id;
} }
// The RemoteVideo was removed (but the DOM elements may still // The RemoteVideo was removed (but the DOM elements may still
// exist). // exist).
} }
console.info("Last visible video no longer exists"); logger.info("Last visible video no longer exists");
thumbs = FilmStrip.getThumbs().remoteThumbs; thumbs = FilmStrip.getThumbs().remoteThumbs;
if (thumbs.length) { if (thumbs.length) {
let id = getPeerContainerResourceId(thumbs[0]); let id = getPeerContainerResourceId(thumbs[0]);
if (remoteVideos[id]) { if (remoteVideos[id]) {
console.info("electLastVisibleVideo: " + id); logger.info("electLastVisibleVideo: " + id);
return id; return id;
} }
// The RemoteVideo was removed (but the DOM elements may // The RemoteVideo was removed (but the DOM elements may
@ -281,10 +282,10 @@ var VideoLayout = {
} }
// Go with local video // Go with local video
console.info("Fallback to local video..."); logger.info("Fallback to local video...");
let id = APP.conference.getMyUserId(); let id = APP.conference.getMyUserId();
console.info("electLastVisibleVideo: " + id); logger.info("electLastVisibleVideo: " + id);
return id; return id;
}, },
@ -426,7 +427,7 @@ var VideoLayout = {
// FIXME: what does this do??? // FIXME: what does this do???
remoteVideoActive(videoElement, resourceJid) { remoteVideoActive(videoElement, resourceJid) {
console.info(resourceJid + " video is now active", videoElement); logger.info(resourceJid + " video is now active", videoElement);
VideoLayout.resizeThumbnails( VideoLayout.resizeThumbnails(
false, false, function() {$(videoElement).show();}); false, false, function() {$(videoElement).show();});
@ -724,11 +725,11 @@ var VideoLayout = {
if (resourceJid && if (resourceJid &&
lastNEndpoints.indexOf(resourceJid) < 0 && lastNEndpoints.indexOf(resourceJid) < 0 &&
localLastNSet.indexOf(resourceJid) < 0) { localLastNSet.indexOf(resourceJid) < 0) {
console.log("Remove from last N", resourceJid); logger.log("Remove from last N", resourceJid);
if (smallVideo) if (smallVideo)
smallVideo.showPeerContainer('hide'); smallVideo.showPeerContainer('hide');
else if (!APP.conference.isLocalId(resourceJid)) else if (!APP.conference.isLocalId(resourceJid))
console.error("No remote video for: " + resourceJid); logger.error("No remote video for: " + resourceJid);
isReceived = false; isReceived = false;
} else if (resourceJid && } else if (resourceJid &&
//TOFIX: smallVideo may be undefined //TOFIX: smallVideo may be undefined
@ -741,7 +742,7 @@ var VideoLayout = {
if (smallVideo) if (smallVideo)
smallVideo.showPeerContainer('avatar'); smallVideo.showPeerContainer('avatar');
else if (!APP.conference.isLocalId(resourceJid)) else if (!APP.conference.isLocalId(resourceJid))
console.error("No remote video for: " + resourceJid); logger.error("No remote video for: " + resourceJid);
isReceived = false; isReceived = false;
} }
@ -768,7 +769,7 @@ var VideoLayout = {
remoteVideo.showPeerContainer('show'); remoteVideo.showPeerContainer('show');
if (!remoteVideo.isVisible()) { if (!remoteVideo.isVisible()) {
console.log("Add to last N", resourceJid); logger.log("Add to last N", resourceJid);
remoteVideo.addRemoteStreamElement(remoteVideo.videoStream); remoteVideo.addRemoteStreamElement(remoteVideo.videoStream);
@ -869,23 +870,23 @@ var VideoLayout = {
removeParticipantContainer (id) { removeParticipantContainer (id) {
// Unlock large video // Unlock large video
if (pinnedId === id) { if (pinnedId === id) {
console.info("Focused video owner has left the conference"); logger.info("Focused video owner has left the conference");
pinnedId = null; pinnedId = null;
} }
if (currentDominantSpeaker === id) { if (currentDominantSpeaker === id) {
console.info("Dominant speaker has left the conference"); logger.info("Dominant speaker has left the conference");
currentDominantSpeaker = null; currentDominantSpeaker = null;
} }
var remoteVideo = remoteVideos[id]; var remoteVideo = remoteVideos[id];
if (remoteVideo) { if (remoteVideo) {
// Remove remote video // Remove remote video
console.info("Removing remote video: " + id); logger.info("Removing remote video: " + id);
delete remoteVideos[id]; delete remoteVideos[id];
remoteVideo.remove(); remoteVideo.remove();
} else { } else {
console.warn("No remote video for " + id); logger.warn("No remote video for " + id);
} }
VideoLayout.resizeThumbnails(); VideoLayout.resizeThumbnails();
@ -896,12 +897,12 @@ var VideoLayout = {
return; return;
} }
console.info("Peer video type changed: ", id, newVideoType); logger.info("Peer video type changed: ", id, newVideoType);
var smallVideo; var smallVideo;
if (APP.conference.isLocalId(id)) { if (APP.conference.isLocalId(id)) {
if (!localVideoThumbnail) { if (!localVideoThumbnail) {
console.warn("Local video not ready yet"); logger.warn("Local video not ready yet");
return; return;
} }
smallVideo = localVideoThumbnail; smallVideo = localVideoThumbnail;
@ -925,7 +926,7 @@ var VideoLayout = {
if (remoteVideo) { if (remoteVideo) {
remoteVideo.connectionIndicator.showMore(); remoteVideo.connectionIndicator.showMore();
} else { } else {
console.info("Error - no remote video for id: " + id); logger.info("Error - no remote video for id: " + id);
} }
} }
}, },
@ -982,7 +983,7 @@ var VideoLayout = {
if (smallVideo) { if (smallVideo) {
smallVideo.avatarChanged(avatarUrl); smallVideo.avatarChanged(avatarUrl);
} else { } else {
console.warn( logger.warn(
"Missed avatar update - no small video yet for " + id "Missed avatar update - no small video yet for " + id
); );
} }

View File

@ -1,4 +1,4 @@
/* global console */ const logger = require("jitsi-meet-logger").getLogger(__filename);
import { redirect } from '../util/helpers'; import { redirect } from '../util/helpers';
@ -45,8 +45,8 @@ export default class ConferenceUrl {
*/ */
this.inviteURL this.inviteURL
= location.protocol + "//" + location.host + location.pathname; = location.protocol + "//" + location.host + location.pathname;
console.info("Stored original conference URL: " + this.originalURL); logger.info("Stored original conference URL: " + this.originalURL);
console.info("Conference URL for invites: " + this.inviteURL); logger.info("Conference URL for invites: " + this.inviteURL);
} }
/** /**
* Obtains the conference invite URL. * Obtains the conference invite URL.
@ -67,7 +67,7 @@ export default class ConferenceUrl {
* Reloads the conference using original URL with all of the parameters. * Reloads the conference using original URL with all of the parameters.
*/ */
reload() { reload() {
console.info("Reloading the conference using URL: " + this.originalURL); logger.info("Reloading the conference using URL: " + this.originalURL);
redirect(this.originalURL); redirect(this.originalURL);
} }
} }

View File

@ -1,3 +1,5 @@
const logger = require("jitsi-meet-logger").getLogger(__filename);
var JSSHA = require('jssha'); var JSSHA = require('jssha');
module.exports = { module.exports = {
@ -22,7 +24,7 @@ module.exports = {
var attemptFirstAddress; var attemptFirstAddress;
config.bosh = config.boshList[idx]; config.bosh = config.boshList[idx];
console.log('Setting config.bosh to ' + config.bosh + logger.log('Setting config.bosh to ' + config.bosh +
' (idx=' + idx + ')'); ' (idx=' + idx + ')');
if (config.boshAttemptFirstList && if (config.boshAttemptFirstList &&
@ -34,10 +36,10 @@ module.exports = {
if (attemptFirstAddress != config.bosh) { if (attemptFirstAddress != config.bosh) {
config.boshAttemptFirst = attemptFirstAddress; config.boshAttemptFirst = attemptFirstAddress;
console.log('Setting config.boshAttemptFirst=' + logger.log('Setting config.boshAttemptFirst=' +
attemptFirstAddress + ' (idx=' + idx + ')'); attemptFirstAddress + ' (idx=' + idx + ')');
} else { } else {
console.log('Not setting boshAttemptFirst, address matches.'); logger.log('Not setting boshAttemptFirst, address matches.');
} }
} }
} }

View File

@ -1,4 +1,5 @@
/* global $, config, interfaceConfig */ /* global $, config, interfaceConfig */
const logger = require("jitsi-meet-logger").getLogger(__filename);
var configUtil = require('./Util'); var configUtil = require('./Util');
@ -16,7 +17,7 @@ var HttpConfig = {
* @param complete * @param complete
*/ */
obtainConfig: function (endpoint, roomName, complete) { obtainConfig: function (endpoint, roomName, complete) {
console.info( logger.info(
"Send config request to " + endpoint + " for room: " + roomName); "Send config request to " + endpoint + " for room: " + roomName);
@ -28,7 +29,7 @@ var HttpConfig = {
data: JSON.stringify({"roomName": roomName}), data: JSON.stringify({"roomName": roomName}),
dataType: 'json', dataType: 'json',
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
console.error("Get config error: ", jqXHR, errorThrown); logger.error("Get config error: ", jqXHR, errorThrown);
var error = "Get config response status: " + textStatus; var error = "Get config response status: " + textStatus;
complete(false, error); complete(false, error);
}, },
@ -39,7 +40,7 @@ var HttpConfig = {
complete(true); complete(true);
return; return;
} catch (exception) { } catch (exception) {
console.error("Parse config error: ", exception); logger.error("Parse config error: ", exception);
complete(false, exception); complete(false, exception);
} }
} }

View File

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

View File

@ -1,3 +1,5 @@
const logger = require("jitsi-meet-logger").getLogger(__filename);
var ConfigUtil = { var ConfigUtil = {
/** /**
* Method overrides JSON properties in <tt>config</tt> and * Method overrides JSON properties in <tt>config</tt> and
@ -31,10 +33,10 @@ var ConfigUtil = {
for (key in newConfig[configRoot]) { for (key in newConfig[configRoot]) {
value = newConfig[configRoot][key]; value = newConfig[configRoot][key];
if (confObj[key] && typeof confObj[key] !== typeof value) { if (confObj[key] && typeof confObj[key] !== typeof value) {
console.log("Overriding a " + configRoot + logger.log("Overriding a " + configRoot +
" property with a property of different type."); " property with a property of different type.");
} }
console.info("Overriding " + key + " with: " + value); logger.info("Overriding " + key + " with: " + value);
confObj[key] = value; confObj[key] = value;
} }
} }

View File

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

View File

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

View File

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