Replace console with logger
This commit is contained in:
parent
a1cc9bce91
commit
b41bf22be7
|
@ -4,6 +4,7 @@ import { AbstractAudioMuteButton } from '../base/toolbox';
|
|||
import type { AbstractButtonProps as Props } from '../base/toolbox';
|
||||
|
||||
const { api } = window.alwaysOnTop;
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* The type of the React {@code Component} state of {@link AudioMuteButton}.
|
||||
|
@ -68,7 +69,7 @@ export default class AudioMuteButton
|
|||
audioAvailable,
|
||||
audioMuted
|
||||
}))
|
||||
.catch(console.error);
|
||||
.catch(logger.error);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@ import { AbstractVideoMuteButton } from '../base/toolbox';
|
|||
import type { AbstractButtonProps as Props } from '../base/toolbox';
|
||||
|
||||
const { api } = window.alwaysOnTop;
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* The type of the React {@code Component} state of {@link VideoMuteButton}.
|
||||
|
@ -68,7 +69,7 @@ export default class VideoMuteButton
|
|||
videoAvailable,
|
||||
videoMuted
|
||||
}))
|
||||
.catch(console.error);
|
||||
.catch(logger.error);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,6 +26,8 @@ import type { Props as AbstractAppProps } from './AbstractApp';
|
|||
|
||||
declare var __DEV__;
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* The type of React {@code Component} props of {@link App}.
|
||||
*/
|
||||
|
@ -196,7 +198,7 @@ function _handleException(error, fatal) {
|
|||
// an unhandled JavascriptException for an unhandled JavaScript error.
|
||||
// This will effectively kill the app. In accord with the Web, do not
|
||||
// kill the app.
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
} else {
|
||||
// Forward to the next globalHandler of ErrorUtils.
|
||||
const { next } = _handleException;
|
||||
|
|
|
@ -11,6 +11,8 @@ import {
|
|||
JITSI_CONFERENCE_URL_KEY
|
||||
} from './constants';
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* Attach a set of local tracks to a conference.
|
||||
*
|
||||
|
@ -172,7 +174,7 @@ export function _removeLocalTracksFromConference(
|
|||
function _reportError(msg, err) {
|
||||
// TODO This is a good point to call some global error handler when we have
|
||||
// one.
|
||||
console.error(msg, err);
|
||||
logger.error(msg, err);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -493,7 +493,7 @@ function _setLastN({ getState }, next, action) {
|
|||
try {
|
||||
conference.setLastN(action.lastN);
|
||||
} catch (err) {
|
||||
console.error(`Failed to set lastN: ${err}`);
|
||||
logger.error(`Failed to set lastN: ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ declare var APP: Object;
|
|||
const JitsiConferenceErrors = JitsiMeetJS.errors.conference;
|
||||
const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* Creates a {@link JitsiLocalTrack} model from the given device id.
|
||||
*
|
||||
|
@ -133,7 +135,7 @@ export function loadConfig(
|
|||
return config;
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(`Failed to load config from ${url}`, err);
|
||||
logger.error(`Failed to load config from ${url}`, err);
|
||||
|
||||
throw err;
|
||||
});
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
import { NativeModules } from 'react-native';
|
||||
import { RTCPeerConnection, RTCSessionDescription } from 'react-native-webrtc';
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
// Address families.
|
||||
|
@ -140,7 +142,7 @@ _RTCPeerConnection.prototype.setRemoteDescription = function(
|
|||
* @returns {void}
|
||||
*/
|
||||
function _LOGE(...args) {
|
||||
console && console.error && console.error(...args);
|
||||
logger.error(...args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -233,7 +233,7 @@ export function setTrackMuted(track, muted) {
|
|||
// Track might be already disposed so ignore such an error.
|
||||
if (error.name !== JitsiTrackErrors.TRACK_IS_DISPOSED) {
|
||||
// FIXME Emit mute failed, so that the app can show error dialog.
|
||||
console.error(`set track ${f} failed`, error);
|
||||
logger.error(`set track ${f} failed`, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// @flow
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* The app linking scheme.
|
||||
* TODO: This should be read from the manifest files later.
|
||||
|
@ -174,7 +176,7 @@ function _objectToURLParamsArray(obj = {}) {
|
|||
params.push(
|
||||
`${key}=${encodeURIComponent(JSON.stringify(obj[key]))}`);
|
||||
} catch (e) {
|
||||
console.warn(`Error encoding ${key}: ${e}`);
|
||||
logger.warn(`Error encoding ${key}: ${e}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* @flow */
|
||||
// @flow
|
||||
|
||||
import { NativeModules } from 'react-native';
|
||||
|
||||
|
@ -11,7 +11,8 @@ import {
|
|||
} from '../../base/conference';
|
||||
import { MiddlewareRegistry } from '../../base/redux';
|
||||
|
||||
const AudioMode = NativeModules.AudioMode;
|
||||
const { AudioMode } = NativeModules;
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* Middleware that captures conference actions and sets the correct audio mode
|
||||
|
@ -59,7 +60,7 @@ MiddlewareRegistry.register(({ getState }) => next => action => {
|
|||
if (typeof mode !== 'undefined') {
|
||||
AudioMode.setMode(mode)
|
||||
.catch(err =>
|
||||
console.error(
|
||||
logger.error(
|
||||
`Failed to set audio mode ${String(mode)}: ${err}`));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import { Platform } from '../../base/react';
|
|||
|
||||
import { ENTER_PICTURE_IN_PICTURE } from './actionTypes';
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* Enters (or rather initiates entering) picture-in-picture.
|
||||
* Helper function to enter PiP mode. This is triggered by user request
|
||||
|
@ -34,7 +36,7 @@ export function enterPictureInPicture() {
|
|||
|
||||
p.then(
|
||||
() => dispatch({ type: ENTER_PICTURE_IN_PICTURE }),
|
||||
e => console.warn(`Error entering PiP mode: ${e}`));
|
||||
e => logger.warn(`Error entering PiP mode: ${e}`));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ import { MiddlewareRegistry } from '../base/redux';
|
|||
import { endShareRoom } from './actions';
|
||||
import { BEGIN_SHARE_ROOM } from './actionTypes';
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* Middleware that captures room URL sharing actions and starts the sharing
|
||||
* process.
|
||||
|
@ -56,7 +58,7 @@ function _shareRoom(roomURL: string, dispatch: Function) {
|
|||
onFulfilled(value.action === Share.sharedAction);
|
||||
},
|
||||
/* onRejected */ reason => {
|
||||
console.error(
|
||||
logger.error(
|
||||
`Failed to share conference/room URL ${roomURL}:`,
|
||||
reason);
|
||||
onFulfilled(false);
|
||||
|
|
|
@ -21,6 +21,8 @@ import { App } from './features/app';
|
|||
import { equals } from './features/base/redux';
|
||||
import { IncomingCallApp } from './features/mobile/incoming-call';
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* The type of the React {@code Component} props of {@link Root}.
|
||||
*/
|
||||
|
@ -74,7 +76,7 @@ class Root extends Component<Props, State> {
|
|||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Failed to get initial URL', err);
|
||||
logger.error('Failed to get initial URL', err);
|
||||
|
||||
if (typeof this.state.url === 'undefined') {
|
||||
// Start with an empty URL if getting the initial URL
|
||||
|
|
Loading…
Reference in New Issue