From 5a934c071a5cbe64de275a25d0ed62d8193cdd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 21 Aug 2019 16:50:00 +0200 Subject: [PATCH] logging: use individual, names loggers React Native doesn't define __filename nor __dirname so do it artisanally. In addition, this helps with centralizing the configuration passed to loggers. --- .../features/always-on-top/AudioMuteButton.js | 3 ++- .../features/always-on-top/VideoMuteButton.js | 3 ++- react/features/always-on-top/logger.js | 3 +++ react/features/analytics/functions.js | 3 +-- react/features/analytics/logger.js | 5 +++++ react/features/app/actions.js | 3 +-- react/features/app/components/App.native.js | 3 +-- react/features/app/logger.js | 5 +++++ react/features/authentication/actions.js | 3 +-- react/features/authentication/logger.js | 5 +++++ react/features/base/app/components/BaseApp.js | 3 +-- react/features/base/app/logger.js | 5 +++++ react/features/base/audio-only/actions.js | 5 +---- react/features/base/audio-only/logger.js | 5 +++++ react/features/base/conference/actions.js | 6 ++--- react/features/base/conference/functions.js | 3 +-- react/features/base/conference/logger.js | 5 +++++ react/features/base/conference/middleware.js | 3 +-- react/features/base/config/functions.any.js | 3 +-- react/features/base/config/logger.js | 5 +++++ .../base/connection/actions.native.js | 3 +-- react/features/base/connection/actions.web.js | 3 +-- react/features/base/connection/logger.js | 5 +++++ react/features/base/devices/actions.js | 3 +-- react/features/base/devices/logger.js | 5 +++++ react/features/base/devices/middleware.js | 3 +-- .../dialog/components/web/DialogWithTabs.js | 2 +- react/features/base/dialog/logger.js | 5 +++++ react/features/base/lastn/logger.js | 5 +++++ react/features/base/lastn/middleware.js | 5 ++--- .../features/base/lib-jitsi-meet/functions.js | 3 +-- react/features/base/lib-jitsi-meet/logger.js | 5 +++++ .../native/RTCPeerConnection.js | 2 +- react/features/base/logging/functions.js | 22 +++++++++++++++++++ react/features/base/logging/index.js | 1 + .../base/media/components/AbstractAudio.js | 2 +- .../base/media/components/native/Audio.js | 4 ++-- react/features/base/media/logger.js | 5 +++++ react/features/base/media/middleware.js | 3 +-- .../components/web/MultiSelectAutocomplete.js | 4 ++-- react/features/base/react/logger.js | 5 +++++ .../base/redux/StateListenerRegistry.js | 2 +- react/features/base/redux/logger.js | 5 +++++ react/features/base/settings/logger.js | 5 +++++ react/features/base/settings/reducer.js | 3 +-- react/features/base/sounds/logger.js | 5 +++++ react/features/base/sounds/middleware.js | 3 +-- react/features/base/sounds/reducer.js | 3 +-- .../base/storage/PersistenceRegistry.js | 2 +- react/features/base/storage/logger.js | 5 +++++ react/features/base/testing/logger.js | 5 +++++ react/features/base/testing/middleware.js | 7 ++---- react/features/base/tracks/actions.js | 3 +-- react/features/base/tracks/functions.js | 2 +- react/features/base/tracks/logger.js | 5 +++++ react/features/base/util/helpers.js | 2 +- react/features/base/util/httpUtils.js | 2 +- react/features/base/util/logger.js | 5 +++++ react/features/base/util/uri.js | 2 +- react/features/blur/actions.js | 3 +-- react/features/blur/logger.js | 5 +++++ react/features/calendar-sync/actions.web.js | 3 +-- .../calendar-sync/functions.native.js | 3 +-- react/features/calendar-sync/functions.web.js | 2 +- react/features/calendar-sync/logger.js | 5 +++++ .../conference/components/web/Conference.js | 4 +--- react/features/conference/logger.js | 5 +++++ react/features/desktop-picker/functions.js | 2 +- react/features/desktop-picker/logger.js | 5 +++++ react/features/device-selection/actions.js | 3 +-- .../components/DeviceSelection.js | 4 ++-- react/features/device-selection/logger.js | 5 +++++ react/features/dropbox/functions.any.js | 3 +-- react/features/dropbox/logger.js | 5 +++++ react/features/follow-me/logger.js | 5 +++++ react/features/follow-me/middleware.js | 3 +-- react/features/invite/actions.js | 3 +-- .../AbstractAddPeopleDialog.js | 2 +- .../components/info-dialog/web/InfoDialog.js | 3 +-- react/features/invite/functions.js | 4 ++-- react/features/invite/logger.js | 5 +++++ react/features/invite/middleware.any.js | 3 +-- react/features/invite/reducer.js | 3 +-- .../controller/RecordingController.js | 3 +-- react/features/local-recording/logger.js | 5 +++++ .../recording/AbstractAudioContextAdapter.js | 3 +-- .../local-recording/recording/OggAdapter.js | 3 +-- .../local-recording/recording/WavAdapter.js | 3 +-- .../recording/flac/FlacAdapter.js | 3 +-- .../recording/flac/flacEncodeWorker.js | 3 +-- .../local-recording/session/SessionManager.js | 2 +- react/features/mobile/audio-mode/logger.js | 5 +++++ .../features/mobile/audio-mode/middleware.js | 2 +- .../mobile/picture-in-picture/actions.js | 3 +-- .../mobile/picture-in-picture/logger.js | 5 +++++ react/features/mobile/watchos/logger.js | 5 +++++ react/features/mobile/watchos/middleware.js | 3 +-- .../components/AbstractPageReloadOverlay.js | 3 +-- react/features/overlay/logger.js | 5 +++++ react/features/recent-list/logger.js | 5 +++++ react/features/recent-list/reducer.js | 3 +-- .../LiveStream/native/GoogleSigninForm.js | 4 ++-- react/features/recording/logger.js | 5 +++++ react/features/room-lock/logger.js | 5 +++++ react/features/room-lock/middleware.js | 3 +-- .../settings/components/web/CalendarTab.js | 2 +- react/features/settings/logger.js | 5 +++++ react/features/share-room/logger.js | 5 +++++ react/features/share-room/middleware.js | 3 +-- react/features/subtitles/logger.js | 5 +++++ react/features/subtitles/middleware.js | 3 +-- .../video-layout/components/TileViewButton.js | 4 +--- react/features/video-layout/logger.js | 5 +++++ .../components/VideoQualitySlider.web.js | 2 +- react/features/video-quality/logger.js | 5 +++++ react/features/videosipgw/logger.js | 5 +++++ react/features/videosipgw/middleware.js | 13 +++++------ react/index.web.js | 3 ++- 118 files changed, 330 insertions(+), 139 deletions(-) create mode 100644 react/features/always-on-top/logger.js create mode 100644 react/features/analytics/logger.js create mode 100644 react/features/app/logger.js create mode 100644 react/features/authentication/logger.js create mode 100644 react/features/base/app/logger.js create mode 100644 react/features/base/audio-only/logger.js create mode 100644 react/features/base/conference/logger.js create mode 100644 react/features/base/config/logger.js create mode 100644 react/features/base/connection/logger.js create mode 100644 react/features/base/devices/logger.js create mode 100644 react/features/base/dialog/logger.js create mode 100644 react/features/base/lastn/logger.js create mode 100644 react/features/base/lib-jitsi-meet/logger.js create mode 100644 react/features/base/logging/functions.js create mode 100644 react/features/base/media/logger.js create mode 100644 react/features/base/react/logger.js create mode 100644 react/features/base/redux/logger.js create mode 100644 react/features/base/settings/logger.js create mode 100644 react/features/base/sounds/logger.js create mode 100644 react/features/base/storage/logger.js create mode 100644 react/features/base/testing/logger.js create mode 100644 react/features/base/tracks/logger.js create mode 100644 react/features/base/util/logger.js create mode 100644 react/features/blur/logger.js create mode 100644 react/features/calendar-sync/logger.js create mode 100644 react/features/conference/logger.js create mode 100644 react/features/desktop-picker/logger.js create mode 100644 react/features/device-selection/logger.js create mode 100644 react/features/dropbox/logger.js create mode 100644 react/features/follow-me/logger.js create mode 100644 react/features/invite/logger.js create mode 100644 react/features/local-recording/logger.js create mode 100644 react/features/mobile/audio-mode/logger.js create mode 100644 react/features/mobile/picture-in-picture/logger.js create mode 100644 react/features/mobile/watchos/logger.js create mode 100644 react/features/overlay/logger.js create mode 100644 react/features/recent-list/logger.js create mode 100644 react/features/recording/logger.js create mode 100644 react/features/room-lock/logger.js create mode 100644 react/features/settings/logger.js create mode 100644 react/features/share-room/logger.js create mode 100644 react/features/subtitles/logger.js create mode 100644 react/features/video-layout/logger.js create mode 100644 react/features/video-quality/logger.js create mode 100644 react/features/videosipgw/logger.js diff --git a/react/features/always-on-top/AudioMuteButton.js b/react/features/always-on-top/AudioMuteButton.js index 85551e046..505b70795 100644 --- a/react/features/always-on-top/AudioMuteButton.js +++ b/react/features/always-on-top/AudioMuteButton.js @@ -5,8 +5,9 @@ import AbstractAudioMuteButton from '../base/toolbox/components/AbstractAudioMuteButton'; import type { Props } from '../base/toolbox/components/AbstractButton'; +import logger from './logger'; + const { api } = window.alwaysOnTop; -const logger = require('jitsi-meet-logger').getLogger(__filename); /** * The type of the React {@code Component} state of {@link AudioMuteButton}. diff --git a/react/features/always-on-top/VideoMuteButton.js b/react/features/always-on-top/VideoMuteButton.js index 874143bbe..64c47812c 100644 --- a/react/features/always-on-top/VideoMuteButton.js +++ b/react/features/always-on-top/VideoMuteButton.js @@ -5,8 +5,9 @@ import AbstractVideoMuteButton from '../base/toolbox/components/AbstractVideoMuteButton'; import type { Props } from '../base/toolbox/components/AbstractButton'; +import logger from './logger'; + const { api } = window.alwaysOnTop; -const logger = require('jitsi-meet-logger').getLogger(__filename); /** * The type of the React {@code Component} state of {@link VideoMuteButton}. diff --git a/react/features/always-on-top/logger.js b/react/features/always-on-top/logger.js new file mode 100644 index 000000000..7324aa95a --- /dev/null +++ b/react/features/always-on-top/logger.js @@ -0,0 +1,3 @@ +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/always-on-top'); diff --git a/react/features/analytics/functions.js b/react/features/analytics/functions.js index 6462e2d39..339d5fa19 100644 --- a/react/features/analytics/functions.js +++ b/react/features/analytics/functions.js @@ -7,8 +7,7 @@ import JitsiMeetJS, { import { getJitsiMeetGlobalNS, loadScript } from '../base/util'; import { AmplitudeHandler } from './handlers'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Sends an event through the lib-jitsi-meet AnalyticsAdapter interface. diff --git a/react/features/analytics/logger.js b/react/features/analytics/logger.js new file mode 100644 index 000000000..fc966546d --- /dev/null +++ b/react/features/analytics/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/analytics'); diff --git a/react/features/app/actions.js b/react/features/app/actions.js index 38db19749..3c0082d19 100644 --- a/react/features/app/actions.js +++ b/react/features/app/actions.js @@ -25,8 +25,7 @@ import { getDefaultURL, getName } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; declare var APP: Object; diff --git a/react/features/app/components/App.native.js b/react/features/app/components/App.native.js index df58b59c2..d12f31fac 100644 --- a/react/features/app/components/App.native.js +++ b/react/features/app/components/App.native.js @@ -27,13 +27,12 @@ import '../../mobile/proximity'; import '../../mobile/wake-lock'; import '../../mobile/watchos'; +import logger from '../logger'; import { AbstractApp } from './AbstractApp'; 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}. */ diff --git a/react/features/app/logger.js b/react/features/app/logger.js new file mode 100644 index 000000000..b2624bb04 --- /dev/null +++ b/react/features/app/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/app'); diff --git a/react/features/authentication/actions.js b/react/features/authentication/actions.js index dca227da2..51e5eaed4 100644 --- a/react/features/authentication/actions.js +++ b/react/features/authentication/actions.js @@ -16,8 +16,7 @@ import { WAIT_FOR_OWNER } from './actionTypes'; import { LoginDialog, WaitForOwnerDialog } from './components'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Initiates authenticating and upgrading the role of the local participant to diff --git a/react/features/authentication/logger.js b/react/features/authentication/logger.js new file mode 100644 index 000000000..9e7b0f582 --- /dev/null +++ b/react/features/authentication/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/authentication'); diff --git a/react/features/base/app/components/BaseApp.js b/react/features/base/app/components/BaseApp.js index fef90f7eb..ac7ca71e4 100644 --- a/react/features/base/app/components/BaseApp.js +++ b/react/features/base/app/components/BaseApp.js @@ -17,8 +17,7 @@ import { SoundCollection } from '../../sounds'; import { PersistenceRegistry } from '../../storage'; import { appWillMount, appWillUnmount } from '../actions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from '../logger'; declare var APP: Object; diff --git a/react/features/base/app/logger.js b/react/features/base/app/logger.js new file mode 100644 index 000000000..32c6b642e --- /dev/null +++ b/react/features/base/app/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/app'); diff --git a/react/features/base/audio-only/actions.js b/react/features/base/audio-only/actions.js index 17a4bb57d..513bfe81d 100644 --- a/react/features/base/audio-only/actions.js +++ b/react/features/base/audio-only/actions.js @@ -1,18 +1,15 @@ // @flow -import { getLogger } from 'jitsi-meet-logger'; - import UIEvents from '../../../../service/UI/UIEvents'; import { createAudioOnlyChangedEvent, sendAnalytics } from '../../analytics'; import { SET_AUDIO_ONLY } from './actionTypes'; +import logger from './logger'; import type { Dispatch } from 'redux'; declare var APP: Object; -const logger = getLogger('features/base/audio-only'); - /** * Sets the audio-only flag for the current JitsiConference. diff --git a/react/features/base/audio-only/logger.js b/react/features/base/audio-only/logger.js new file mode 100644 index 000000000..46f4687df --- /dev/null +++ b/react/features/base/audio-only/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/audio-only'); diff --git a/react/features/base/conference/actions.js b/react/features/base/conference/actions.js index 71cecfd73..875a12464 100644 --- a/react/features/base/conference/actions.js +++ b/react/features/base/conference/actions.js @@ -1,5 +1,7 @@ // @flow +import type { Dispatch } from 'redux'; + import { createStartMutedConfigurationEvent, sendAnalytics @@ -58,9 +60,7 @@ import { getCurrentConference, sendLocalParticipant } from './functions'; -import type { Dispatch } from 'redux'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; declare var APP: Object; diff --git a/react/features/base/conference/functions.js b/react/features/base/conference/functions.js index 493c159a4..10a461de5 100644 --- a/react/features/base/conference/functions.js +++ b/react/features/base/conference/functions.js @@ -19,8 +19,7 @@ import { JITSI_CONFERENCE_URL_KEY, VIDEO_QUALITY_LEVELS } from './constants'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Attach a set of local tracks to a conference. diff --git a/react/features/base/conference/logger.js b/react/features/base/conference/logger.js new file mode 100644 index 000000000..bc08bb126 --- /dev/null +++ b/react/features/base/conference/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/conference'); diff --git a/react/features/base/conference/middleware.js b/react/features/base/conference/middleware.js index 9c8b8a2d0..83c1ed656 100644 --- a/react/features/base/conference/middleware.js +++ b/react/features/base/conference/middleware.js @@ -41,8 +41,7 @@ import { forEachConference, getCurrentConference } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; declare var APP: Object; diff --git a/react/features/base/config/functions.any.js b/react/features/base/config/functions.any.js index 3ca9c42d4..be2bf038a 100644 --- a/react/features/base/config/functions.any.js +++ b/react/features/base/config/functions.any.js @@ -4,6 +4,7 @@ import _ from 'lodash'; import { _CONFIG_STORE_PREFIX } from './constants'; import parseURLParams from './parseURLParams'; +import logger from './logger'; declare var $: Object; @@ -147,8 +148,6 @@ const WHITELISTED_KEYS = [ 'webrtcIceUdpDisable' ]; -const logger = require('jitsi-meet-logger').getLogger(__filename); - // XXX The functions getRoomName and parseURLParams are split out of // functions.js because they are bundled in both app.bundle and // do_external_connect, webpack 1 does not support tree shaking, and we don't diff --git a/react/features/base/config/logger.js b/react/features/base/config/logger.js new file mode 100644 index 000000000..86b320c93 --- /dev/null +++ b/react/features/base/config/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/config'); diff --git a/react/features/base/connection/actions.native.js b/react/features/base/connection/actions.native.js index 0f2d0a58a..7cbeca4ca 100644 --- a/react/features/base/connection/actions.native.js +++ b/react/features/base/connection/actions.native.js @@ -19,8 +19,7 @@ import { SET_LOCATION_URL } from './actionTypes'; import { JITSI_CONNECTION_URL_KEY } from './constants'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * The error structure passed to the {@link connectionFailed} action. diff --git a/react/features/base/connection/actions.web.js b/react/features/base/connection/actions.web.js index b625f9f1d..fe3ddb697 100644 --- a/react/features/base/connection/actions.web.js +++ b/react/features/base/connection/actions.web.js @@ -5,8 +5,6 @@ import type { Dispatch } from 'redux'; declare var APP: Object; declare var config: Object; -const logger = require('jitsi-meet-logger').getLogger(__filename); - import { configureInitialDevices } from '../devices'; export { @@ -14,6 +12,7 @@ export { connectionFailed, setLocationURL } from './actions.native'; +import logger from './logger'; /** * Opens new connection. diff --git a/react/features/base/connection/logger.js b/react/features/base/connection/logger.js new file mode 100644 index 000000000..dc234ff78 --- /dev/null +++ b/react/features/base/connection/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/connection'); diff --git a/react/features/base/devices/actions.js b/react/features/base/devices/actions.js index 28203cb18..b05ea8dd9 100644 --- a/react/features/base/devices/actions.js +++ b/react/features/base/devices/actions.js @@ -20,8 +20,7 @@ import { getDevicesFromURL, setAudioOutputDeviceId } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Maps the WebRTC string for device type to the keys used to store configure, diff --git a/react/features/base/devices/logger.js b/react/features/base/devices/logger.js new file mode 100644 index 000000000..8a99c13de --- /dev/null +++ b/react/features/base/devices/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/devices'); diff --git a/react/features/base/devices/middleware.js b/react/features/base/devices/middleware.js index 49688ed41..7b42fc8fb 100644 --- a/react/features/base/devices/middleware.js +++ b/react/features/base/devices/middleware.js @@ -21,8 +21,7 @@ import { import { showNotification, showWarningNotification } from '../../notifications'; import { updateSettings } from '../settings'; import { setAudioOutputDeviceId } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; const JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP = { microphone: { diff --git a/react/features/base/dialog/components/web/DialogWithTabs.js b/react/features/base/dialog/components/web/DialogWithTabs.js index 3508fec8c..52037e7ff 100644 --- a/react/features/base/dialog/components/web/DialogWithTabs.js +++ b/react/features/base/dialog/components/web/DialogWithTabs.js @@ -6,7 +6,7 @@ import React, { Component } from 'react'; import { StatelessDialog } from '../../../dialog'; import { translate } from '../../../i18n'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from '../../logger'; /** * The type of the React {@code Component} props of {@link DialogWithTabs}. diff --git a/react/features/base/dialog/logger.js b/react/features/base/dialog/logger.js new file mode 100644 index 000000000..023563011 --- /dev/null +++ b/react/features/base/dialog/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/dialog'); diff --git a/react/features/base/lastn/logger.js b/react/features/base/lastn/logger.js new file mode 100644 index 000000000..e0d7e1312 --- /dev/null +++ b/react/features/base/lastn/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/lastn'); diff --git a/react/features/base/lastn/middleware.js b/react/features/base/lastn/middleware.js index 08d3c1422..27b0754d7 100644 --- a/react/features/base/lastn/middleware.js +++ b/react/features/base/lastn/middleware.js @@ -1,7 +1,5 @@ // @flow -import { getLogger } from 'jitsi-meet-logger'; - import { SET_FILMSTRIP_ENABLED } from '../../filmstrip/actionTypes'; import { SELECT_LARGE_VIDEO_PARTICIPANT } from '../../large-video/actionTypes'; import { APP_STATE_CHANGED } from '../../mobile/background/actionTypes'; @@ -12,8 +10,9 @@ import { CONFERENCE_JOINED } from '../conference/actionTypes'; import { getParticipantById } from '../participants/functions'; import { MiddlewareRegistry } from '../redux'; +import logger from './logger'; + declare var APP: Object; -const logger = getLogger('features/base/lastn'); MiddlewareRegistry.register(store => next => action => { diff --git a/react/features/base/lib-jitsi-meet/functions.js b/react/features/base/lib-jitsi-meet/functions.js index bc99e3909..64d3f7815 100644 --- a/react/features/base/lib-jitsi-meet/functions.js +++ b/react/features/base/lib-jitsi-meet/functions.js @@ -4,14 +4,13 @@ import { toState } from '../redux'; import { loadScript } from '../util'; import JitsiMeetJS from './_'; +import logger from './logger'; 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. * diff --git a/react/features/base/lib-jitsi-meet/logger.js b/react/features/base/lib-jitsi-meet/logger.js new file mode 100644 index 000000000..210ff96f5 --- /dev/null +++ b/react/features/base/lib-jitsi-meet/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/lib-jitsi-meet'); diff --git a/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js b/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js index 468228c90..60450745e 100644 --- a/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js +++ b/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js @@ -3,7 +3,7 @@ import { NativeModules } from 'react-native'; import { RTCPeerConnection, RTCSessionDescription } from 'react-native-webrtc'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from '../logger'; /* eslint-disable no-unused-vars */ diff --git a/react/features/base/logging/functions.js b/react/features/base/logging/functions.js new file mode 100644 index 000000000..266c84a32 --- /dev/null +++ b/react/features/base/logging/functions.js @@ -0,0 +1,22 @@ +// @flow + +import { getLogger as _getLogger } from 'jitsi-meet-logger'; + +/** + * Options for building the logger. We disable the callee info on RN because it's + * almost always empty anyway. + */ +const DEFAULT_OPTS = {}; +const DEFAULT_RN_OPTS = { disableCallerInfo: true }; + +/** + * Gets a logger for the given id. + * + * @param {string} id - Name for the logger. + * @returns {Object} - The logger object. + */ +export function getLogger(id: string) { + const opts = navigator.product === 'ReactNative' ? DEFAULT_RN_OPTS : DEFAULT_OPTS; + + return _getLogger(id, undefined, opts); +} diff --git a/react/features/base/logging/index.js b/react/features/base/logging/index.js index f3a2aac65..969667b3a 100644 --- a/react/features/base/logging/index.js +++ b/react/features/base/logging/index.js @@ -1,5 +1,6 @@ export * from './actions'; export * from './actionTypes'; +export * from './functions'; import './middleware'; import './reducer'; diff --git a/react/features/base/media/components/AbstractAudio.js b/react/features/base/media/components/AbstractAudio.js index 157475724..698d539bc 100644 --- a/react/features/base/media/components/AbstractAudio.js +++ b/react/features/base/media/components/AbstractAudio.js @@ -2,7 +2,7 @@ import { Component } from 'react'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from '../logger'; /** * Describes audio element interface used in the base/media feature for audio diff --git a/react/features/base/media/components/native/Audio.js b/react/features/base/media/components/native/Audio.js index e9007b2f7..4cbf8c2fe 100644 --- a/react/features/base/media/components/native/Audio.js +++ b/react/features/base/media/components/native/Audio.js @@ -2,9 +2,9 @@ import Sound from 'react-native-sound'; -import AbstractAudio from '../AbstractAudio'; +import logger from '../../logger'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import AbstractAudio from '../AbstractAudio'; /** * The React Native/mobile {@link Component} which is similar to Web's diff --git a/react/features/base/media/logger.js b/react/features/base/media/logger.js new file mode 100644 index 000000000..6468f3e4e --- /dev/null +++ b/react/features/base/media/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/media'); diff --git a/react/features/base/media/middleware.js b/react/features/base/media/middleware.js index 4f14f5710..1b30b9b20 100644 --- a/react/features/base/media/middleware.js +++ b/react/features/base/media/middleware.js @@ -18,13 +18,12 @@ import { setTrackMuted, TRACK_ADDED } from '../tracks'; import { setAudioMuted, setCameraFacingMode, setVideoMuted } from './actions'; import { CAMERA_FACING_MODE, VIDEO_MUTISM_AUTHORITY } from './constants'; +import logger from './logger'; import { _AUDIO_INITIAL_MEDIA_STATE, _VIDEO_INITIAL_MEDIA_STATE } from './reducer'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * Implements the entry point of the middleware of the feature base/media. * diff --git a/react/features/base/react/components/web/MultiSelectAutocomplete.js b/react/features/base/react/components/web/MultiSelectAutocomplete.js index 5556a28b0..1111d344c 100644 --- a/react/features/base/react/components/web/MultiSelectAutocomplete.js +++ b/react/features/base/react/components/web/MultiSelectAutocomplete.js @@ -5,9 +5,9 @@ import AKInlineDialog from '@atlaskit/inline-dialog'; import _debounce from 'lodash/debounce'; import React, { Component } from 'react'; -import InlineDialogFailure from './InlineDialogFailure'; +import logger from '../../logger'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import InlineDialogFailure from './InlineDialogFailure'; /** * The type of the React {@code Component} props of diff --git a/react/features/base/react/logger.js b/react/features/base/react/logger.js new file mode 100644 index 000000000..18ff002fa --- /dev/null +++ b/react/features/base/react/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/react'); diff --git a/react/features/base/redux/StateListenerRegistry.js b/react/features/base/redux/StateListenerRegistry.js index a5f35abb6..cc68decbf 100644 --- a/react/features/base/redux/StateListenerRegistry.js +++ b/react/features/base/redux/StateListenerRegistry.js @@ -2,7 +2,7 @@ import type { Store } from 'redux'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * The type listener supported for registration with diff --git a/react/features/base/redux/logger.js b/react/features/base/redux/logger.js new file mode 100644 index 000000000..d6d6482ba --- /dev/null +++ b/react/features/base/redux/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/redux'); diff --git a/react/features/base/settings/logger.js b/react/features/base/settings/logger.js new file mode 100644 index 000000000..824bcf3e9 --- /dev/null +++ b/react/features/base/settings/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/settings'); diff --git a/react/features/base/settings/reducer.js b/react/features/base/settings/reducer.js index 540da6337..9220cafe6 100644 --- a/react/features/base/settings/reducer.js +++ b/react/features/base/settings/reducer.js @@ -10,8 +10,7 @@ import { PersistenceRegistry } from '../storage'; import { assignIfDefined } from '../util'; import { SETTINGS_UPDATED } from './actionTypes'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * The default/initial redux state of the feature {@code base/settings}. diff --git a/react/features/base/sounds/logger.js b/react/features/base/sounds/logger.js new file mode 100644 index 000000000..8f5c7c322 --- /dev/null +++ b/react/features/base/sounds/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/sounds'); diff --git a/react/features/base/sounds/middleware.js b/react/features/base/sounds/middleware.js index 3c3ffc002..dfa0f40ee 100644 --- a/react/features/base/sounds/middleware.js +++ b/react/features/base/sounds/middleware.js @@ -3,8 +3,7 @@ import { MiddlewareRegistry } from '../redux'; import { PLAY_SOUND, STOP_SOUND } from './actionTypes'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Implements the entry point of the middleware of the feature base/media. diff --git a/react/features/base/sounds/reducer.js b/react/features/base/sounds/reducer.js index a5e7ac5fc..939552d22 100644 --- a/react/features/base/sounds/reducer.js +++ b/react/features/base/sounds/reducer.js @@ -9,8 +9,7 @@ import { REGISTER_SOUND, UNREGISTER_SOUND } from './actionTypes'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * The structure use by this reducer to describe a sound. diff --git a/react/features/base/storage/PersistenceRegistry.js b/react/features/base/storage/PersistenceRegistry.js index f684aa371..66dc12810 100644 --- a/react/features/base/storage/PersistenceRegistry.js +++ b/react/features/base/storage/PersistenceRegistry.js @@ -2,7 +2,7 @@ import md5 from 'js-md5'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * The name of the {@code localStorage} store where the app persists its values. diff --git a/react/features/base/storage/logger.js b/react/features/base/storage/logger.js new file mode 100644 index 000000000..ed620ca50 --- /dev/null +++ b/react/features/base/storage/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/storage'); diff --git a/react/features/base/testing/logger.js b/react/features/base/testing/logger.js new file mode 100644 index 000000000..a762f52a9 --- /dev/null +++ b/react/features/base/testing/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/testing'); diff --git a/react/features/base/testing/middleware.js b/react/features/base/testing/middleware.js index 733aef81e..f4b830e37 100644 --- a/react/features/base/testing/middleware.js +++ b/react/features/base/testing/middleware.js @@ -1,14 +1,11 @@ -/* @flow */ - -import Logger from 'jitsi-meet-logger'; - -const logger = Logger.getLogger(__filename); +// @flow import { MiddlewareRegistry } from '../redux'; import { CONFERENCE_WILL_JOIN } from '../conference'; import { JitsiConferenceEvents } from '../lib-jitsi-meet'; import { setConnectionState } from './actions'; +import logger from './logger'; /** * The Redux middleware of the feature testing. diff --git a/react/features/base/tracks/actions.js b/react/features/base/tracks/actions.js index 53cb65384..3046b29ef 100644 --- a/react/features/base/tracks/actions.js +++ b/react/features/base/tracks/actions.js @@ -24,8 +24,7 @@ import { TRACK_WILL_CREATE } from './actionTypes'; import { createLocalTracksF, getLocalTrack, getLocalTracks, getTrackByJitsiTrack } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Requests the creating of the desired media type tracks. Desire is expressed diff --git a/react/features/base/tracks/functions.js b/react/features/base/tracks/functions.js index 34dcff8de..1f5a12102 100644 --- a/react/features/base/tracks/functions.js +++ b/react/features/base/tracks/functions.js @@ -8,7 +8,7 @@ import { getUserSelectedMicDeviceId } from '../settings'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Create local tracks of specific types. diff --git a/react/features/base/tracks/logger.js b/react/features/base/tracks/logger.js new file mode 100644 index 000000000..54bc5de70 --- /dev/null +++ b/react/features/base/tracks/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/tracks'); diff --git a/react/features/base/util/helpers.js b/react/features/base/util/helpers.js index fe813af73..1f11fc879 100644 --- a/react/features/base/util/helpers.js +++ b/react/features/base/util/helpers.js @@ -1,6 +1,6 @@ // @flow -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Creates a deferred object. diff --git a/react/features/base/util/httpUtils.js b/react/features/base/util/httpUtils.js index 3f4eb37af..5479267c9 100644 --- a/react/features/base/util/httpUtils.js +++ b/react/features/base/util/httpUtils.js @@ -1,6 +1,6 @@ import { timeoutPromise } from './timeoutPromise'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * The number of milliseconds before deciding that we need retry a fetch request. diff --git a/react/features/base/util/logger.js b/react/features/base/util/logger.js new file mode 100644 index 000000000..82d31be58 --- /dev/null +++ b/react/features/base/util/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../logging/functions'; + +export default getLogger('features/base/util'); diff --git a/react/features/base/util/uri.js b/react/features/base/util/uri.js index d48e36d6c..60d639391 100644 --- a/react/features/base/util/uri.js +++ b/react/features/base/util/uri.js @@ -1,6 +1,6 @@ // @flow -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * The app linking scheme. diff --git a/react/features/blur/actions.js b/react/features/blur/actions.js index 34c7e8ce2..76382ccfa 100644 --- a/react/features/blur/actions.js +++ b/react/features/blur/actions.js @@ -4,8 +4,7 @@ import { getLocalVideoTrack } from '../../features/base/tracks'; import { BLUR_DISABLED, BLUR_ENABLED } from './actionTypes'; import { getBlurEffect } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Signals the local participant is switching between blurred or non blurred video. diff --git a/react/features/blur/logger.js b/react/features/blur/logger.js new file mode 100644 index 000000000..f83fb5658 --- /dev/null +++ b/react/features/blur/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/blur'); diff --git a/react/features/calendar-sync/actions.web.js b/react/features/calendar-sync/actions.web.js index 7fdf57dc5..64339f7d8 100644 --- a/react/features/calendar-sync/actions.web.js +++ b/react/features/calendar-sync/actions.web.js @@ -17,11 +17,10 @@ import { SET_LOADING_CALENDAR_EVENTS } from './actionTypes'; import { _getCalendarIntegration, isCalendarEnabled } from './functions'; +import logger from './logger'; export * from './actions.any'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * Sets the initial state of calendar integration by loading third party APIs * and filling out any data that needs to be fetched. diff --git a/react/features/calendar-sync/functions.native.js b/react/features/calendar-sync/functions.native.js index 09e027b12..7c582a95e 100644 --- a/react/features/calendar-sync/functions.native.js +++ b/react/features/calendar-sync/functions.native.js @@ -10,11 +10,10 @@ import { getShareInfoText } from '../invite'; import { setCalendarAuthorization } from './actions'; import { FETCH_END_DAYS, FETCH_START_DAYS } from './constants'; import { _updateCalendarEntries } from './functions'; +import logger from './logger'; export * from './functions.any'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * Adds a Jitsi link to a calendar entry. * diff --git a/react/features/calendar-sync/functions.web.js b/react/features/calendar-sync/functions.web.js index c061d7f1b..54cacb7c0 100644 --- a/react/features/calendar-sync/functions.web.js +++ b/react/features/calendar-sync/functions.web.js @@ -18,7 +18,7 @@ import { googleCalendarApi } from './web/googleCalendar'; import { microsoftCalendarApi } from './web/microsoftCalendar'; import { toState } from '../base/redux'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Determines whether the calendar feature is enabled by the web. diff --git a/react/features/calendar-sync/logger.js b/react/features/calendar-sync/logger.js new file mode 100644 index 000000000..f252bcf17 --- /dev/null +++ b/react/features/calendar-sync/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/calendar-sync'); diff --git a/react/features/conference/components/web/Conference.js b/react/features/conference/components/web/Conference.js index 28698a4d6..b0ecf0f20 100644 --- a/react/features/conference/components/web/Conference.js +++ b/react/features/conference/components/web/Conference.js @@ -23,6 +23,7 @@ import { } from '../../../toolbox'; import { maybeShowSuboptimalExperienceNotification } from '../../functions'; +import logger from '../../logger'; import Labels from './Labels'; import { default as Notice } from './Notice'; @@ -31,15 +32,12 @@ import { AbstractConference, abstractMapStateToProps } from '../AbstractConference'; - import type { AbstractProps } from '../AbstractConference'; declare var APP: Object; declare var config: Object; declare var interfaceConfig: Object; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * DOM events for when full screen mode has changed. Different browsers need * different vendor prefixes. diff --git a/react/features/conference/logger.js b/react/features/conference/logger.js new file mode 100644 index 000000000..352219cb9 --- /dev/null +++ b/react/features/conference/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/conference'); diff --git a/react/features/desktop-picker/functions.js b/react/features/desktop-picker/functions.js index b90d9794a..7834a21b4 100644 --- a/react/features/desktop-picker/functions.js +++ b/react/features/desktop-picker/functions.js @@ -1,5 +1,5 @@ -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Begins a request to get available DesktopCapturerSources. diff --git a/react/features/desktop-picker/logger.js b/react/features/desktop-picker/logger.js new file mode 100644 index 000000000..ad5c9dc29 --- /dev/null +++ b/react/features/desktop-picker/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/desktop-picker'); diff --git a/react/features/device-selection/actions.js b/react/features/device-selection/actions.js index dde51dfc7..b367c83ad 100644 --- a/react/features/device-selection/actions.js +++ b/react/features/device-selection/actions.js @@ -16,8 +16,7 @@ import { updateSettings } from '../base/settings'; import { SET_DEVICE_SELECTION_POPUP_DATA } from './actionTypes'; import { getDeviceSelectionDialogProps, processExternalDeviceRequest } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Opens a popup window with the device selection dialog in it. diff --git a/react/features/device-selection/components/DeviceSelection.js b/react/features/device-selection/components/DeviceSelection.js index 487e1c591..136ec62c2 100644 --- a/react/features/device-selection/components/DeviceSelection.js +++ b/react/features/device-selection/components/DeviceSelection.js @@ -7,13 +7,13 @@ import type { Props as AbstractDialogTabProps } from '../../base/dialog'; import { translate } from '../../base/i18n'; import JitsiMeetJS, { createLocalTrack } from '../../base/lib-jitsi-meet'; +import logger from '../logger'; + import AudioInputPreview from './AudioInputPreview'; import AudioOutputPreview from './AudioOutputPreview'; import DeviceSelector from './DeviceSelector'; import VideoInputPreview from './VideoInputPreview'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * The type of the React {@code Component} props of {@link DeviceSelection}. */ diff --git a/react/features/device-selection/logger.js b/react/features/device-selection/logger.js new file mode 100644 index 000000000..b18cf68da --- /dev/null +++ b/react/features/device-selection/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/device-selection'); diff --git a/react/features/dropbox/functions.any.js b/react/features/dropbox/functions.any.js index 388f31dab..1a587c82a 100644 --- a/react/features/dropbox/functions.any.js +++ b/react/features/dropbox/functions.any.js @@ -2,8 +2,7 @@ export * from './functions'; import { getDisplayName, getSpaceUsage } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Information related to the user's dropbox account. diff --git a/react/features/dropbox/logger.js b/react/features/dropbox/logger.js new file mode 100644 index 000000000..f9a037688 --- /dev/null +++ b/react/features/dropbox/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/dropbox'); diff --git a/react/features/follow-me/logger.js b/react/features/follow-me/logger.js new file mode 100644 index 000000000..0853fd3de --- /dev/null +++ b/react/features/follow-me/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/follow-me'); diff --git a/react/features/follow-me/middleware.js b/react/features/follow-me/middleware.js index 582d07e2c..b1b266b4f 100644 --- a/react/features/follow-me/middleware.js +++ b/react/features/follow-me/middleware.js @@ -16,8 +16,7 @@ import { setFilmstripVisible } from '../filmstrip'; import { setTileView } from '../video-layout'; import { FOLLOW_ME_COMMAND } from './constants'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; declare var APP: Object; diff --git a/react/features/invite/actions.js b/react/features/invite/actions.js index 964d4e514..1086dc90b 100644 --- a/react/features/invite/actions.js +++ b/react/features/invite/actions.js @@ -21,8 +21,7 @@ import { getDialInNumbers, invitePeopleAndChatRooms } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Creates a (redux) action to signal that a click/tap has been performed on diff --git a/react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js b/react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js index 8a69ed96b..c10c10686 100644 --- a/react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js +++ b/react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.js @@ -16,7 +16,7 @@ import { showNotification } from '../../../notifications'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from '../../logger'; export type Props = { diff --git a/react/features/invite/components/info-dialog/web/InfoDialog.js b/react/features/invite/components/info-dialog/web/InfoDialog.js index b695e7086..cb327104b 100644 --- a/react/features/invite/components/info-dialog/web/InfoDialog.js +++ b/react/features/invite/components/info-dialog/web/InfoDialog.js @@ -18,11 +18,10 @@ import { _getDefaultPhoneNumber, getDialInfoPageURL } from '../../../functions'; +import logger from '../../../logger'; import DialInNumber from './DialInNumber'; import PasswordForm from './PasswordForm'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * The type of the React {@code Component} props of {@link InfoDialog}. */ diff --git a/react/features/invite/functions.js b/react/features/invite/functions.js index 7650afdc1..41fbd2eb3 100644 --- a/react/features/invite/functions.js +++ b/react/features/invite/functions.js @@ -4,11 +4,11 @@ import { i18next } from '../base/i18n'; import { isLocalParticipantModerator } from '../base/participants'; import { doGetJSON, parseURIString } from '../base/util'; +import logger from './logger'; + declare var $: Function; declare var interfaceConfig: Object; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * Sends an ajax request to check if the phone number can be called. * diff --git a/react/features/invite/logger.js b/react/features/invite/logger.js new file mode 100644 index 000000000..4e9e3106f --- /dev/null +++ b/react/features/invite/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/invite'); diff --git a/react/features/invite/middleware.any.js b/react/features/invite/middleware.any.js index bc39a0bca..e82a61de5 100644 --- a/react/features/invite/middleware.any.js +++ b/react/features/invite/middleware.any.js @@ -45,10 +45,9 @@ import { OUTGOING_CALL_RINGING_SOUND_ID, OUTGOING_CALL_START_SOUND_ID } from './constants'; +import logger from './logger'; import { sounds } from './sounds'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - declare var interfaceConfig: Object; /** diff --git a/react/features/invite/reducer.js b/react/features/invite/reducer.js index b151fd262..4e11f5891 100644 --- a/react/features/invite/reducer.js +++ b/react/features/invite/reducer.js @@ -11,8 +11,7 @@ import { UPDATE_DIAL_IN_NUMBERS_FAILED, UPDATE_DIAL_IN_NUMBERS_SUCCESS } from './actionTypes'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; const DEFAULT_STATE = { /** diff --git a/react/features/local-recording/controller/RecordingController.js b/react/features/local-recording/controller/RecordingController.js index 146292fb9..923e24217 100644 --- a/react/features/local-recording/controller/RecordingController.js +++ b/react/features/local-recording/controller/RecordingController.js @@ -2,6 +2,7 @@ import { i18next } from '../../base/i18n'; +import logger from '../logger'; import { FlacAdapter, OggAdapter, @@ -10,8 +11,6 @@ import { } from '../recording'; import { sessionManager } from '../session'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * XMPP command for signaling the start of local recording to all clients. * Should be sent by the moderator only. diff --git a/react/features/local-recording/logger.js b/react/features/local-recording/logger.js new file mode 100644 index 000000000..cfe783ba5 --- /dev/null +++ b/react/features/local-recording/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/local-recording'); diff --git a/react/features/local-recording/recording/AbstractAudioContextAdapter.js b/react/features/local-recording/recording/AbstractAudioContextAdapter.js index 26cf40c11..6416e93c8 100644 --- a/react/features/local-recording/recording/AbstractAudioContextAdapter.js +++ b/react/features/local-recording/recording/AbstractAudioContextAdapter.js @@ -1,7 +1,6 @@ +import logger from '../logger'; import { RecordingAdapter } from './RecordingAdapter'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * Base class for {@code AudioContext}-based recording adapters. */ diff --git a/react/features/local-recording/recording/OggAdapter.js b/react/features/local-recording/recording/OggAdapter.js index fdb03e8c6..781f652ed 100644 --- a/react/features/local-recording/recording/OggAdapter.js +++ b/react/features/local-recording/recording/OggAdapter.js @@ -1,7 +1,6 @@ +import logger from '../logger'; import { RecordingAdapter } from './RecordingAdapter'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * Recording adapter that uses {@code MediaRecorder} (default browser encoding * with Opus codec). diff --git a/react/features/local-recording/recording/WavAdapter.js b/react/features/local-recording/recording/WavAdapter.js index 4e36d5c5d..37bde7df7 100644 --- a/react/features/local-recording/recording/WavAdapter.js +++ b/react/features/local-recording/recording/WavAdapter.js @@ -1,7 +1,6 @@ +import logger from '../logger'; import { AbstractAudioContextAdapter } from './AbstractAudioContextAdapter'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - const WAV_BITS_PER_SAMPLE = 16; /** diff --git a/react/features/local-recording/recording/flac/FlacAdapter.js b/react/features/local-recording/recording/flac/FlacAdapter.js index 32f0dd881..715f34dfa 100644 --- a/react/features/local-recording/recording/flac/FlacAdapter.js +++ b/react/features/local-recording/recording/flac/FlacAdapter.js @@ -1,3 +1,4 @@ +import logger from '../../logger'; import { DEBUG, MAIN_THREAD_FINISH, @@ -9,8 +10,6 @@ import { import { AbstractAudioContextAdapter } from '../AbstractAudioContextAdapter'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * Recording adapter that uses libflac.js in the background. */ diff --git a/react/features/local-recording/recording/flac/flacEncodeWorker.js b/react/features/local-recording/recording/flac/flacEncodeWorker.js index ab9508f9d..cc197dbd0 100644 --- a/react/features/local-recording/recording/flac/flacEncodeWorker.js +++ b/react/features/local-recording/recording/flac/flacEncodeWorker.js @@ -1,3 +1,4 @@ +import logger from '../../logger'; import { MAIN_THREAD_FINISH, MAIN_THREAD_INIT, @@ -6,8 +7,6 @@ import { WORKER_LIBFLAC_READY } from './messageTypes'; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * WebWorker that does FLAC encoding using libflac.js */ diff --git a/react/features/local-recording/session/SessionManager.js b/react/features/local-recording/session/SessionManager.js index fb12a6e0b..d7c1753f9 100644 --- a/react/features/local-recording/session/SessionManager.js +++ b/react/features/local-recording/session/SessionManager.js @@ -2,7 +2,7 @@ import jitsiLocalStorage from '../../../../modules/util/JitsiLocalStorage'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from '../logger'; /** * Gets high precision system time. diff --git a/react/features/mobile/audio-mode/logger.js b/react/features/mobile/audio-mode/logger.js new file mode 100644 index 000000000..a2b68d0d1 --- /dev/null +++ b/react/features/mobile/audio-mode/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../../base/logging/functions'; + +export default getLogger('features/mobile/audio-mode'); diff --git a/react/features/mobile/audio-mode/middleware.js b/react/features/mobile/audio-mode/middleware.js index e15409520..6eb56d4de 100644 --- a/react/features/mobile/audio-mode/middleware.js +++ b/react/features/mobile/audio-mode/middleware.js @@ -13,10 +13,10 @@ import { import { MiddlewareRegistry } from '../../base/redux'; import { _SET_AUDIOMODE_DEVICES, _SET_AUDIOMODE_SUBSCRIPTIONS } from './actionTypes'; +import logger from './logger'; const { AudioMode } = NativeModules; const AudioModeEmitter = new NativeEventEmitter(AudioMode); -const logger = require('jitsi-meet-logger').getLogger(__filename); /** * Middleware that captures conference actions and sets the correct audio mode diff --git a/react/features/mobile/picture-in-picture/actions.js b/react/features/mobile/picture-in-picture/actions.js index e3b8de82e..e1ddf1fc0 100644 --- a/react/features/mobile/picture-in-picture/actions.js +++ b/react/features/mobile/picture-in-picture/actions.js @@ -7,8 +7,7 @@ import { PIP_ENABLED, getFeatureFlag } from '../../base/flags'; import { Platform } from '../../base/react'; import { ENTER_PICTURE_IN_PICTURE } from './actionTypes'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Enters (or rather initiates entering) picture-in-picture. diff --git a/react/features/mobile/picture-in-picture/logger.js b/react/features/mobile/picture-in-picture/logger.js new file mode 100644 index 000000000..2b21a05e5 --- /dev/null +++ b/react/features/mobile/picture-in-picture/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../../base/logging/functions'; + +export default getLogger('features/mobile/pip'); diff --git a/react/features/mobile/watchos/logger.js b/react/features/mobile/watchos/logger.js new file mode 100644 index 000000000..cb29b386f --- /dev/null +++ b/react/features/mobile/watchos/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../../base/logging/functions'; + +export default getLogger('features/mobile/watchos'); diff --git a/react/features/mobile/watchos/middleware.js b/react/features/mobile/watchos/middleware.js index ea9b9802c..4cabd6cb2 100644 --- a/react/features/mobile/watchos/middleware.js +++ b/react/features/mobile/watchos/middleware.js @@ -17,8 +17,7 @@ import { import { setConferenceTimestamp, setSessionId, setWatchReachable } from './actions'; import { CMD_HANG_UP, CMD_JOIN_CONFERENCE, CMD_SET_MUTED, MAX_RECENT_URLS } from './constants'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; const watchOSEnabled = Platform.OS === 'ios'; diff --git a/react/features/overlay/components/AbstractPageReloadOverlay.js b/react/features/overlay/components/AbstractPageReloadOverlay.js index 5575ab87f..c0e1f636e 100644 --- a/react/features/overlay/components/AbstractPageReloadOverlay.js +++ b/react/features/overlay/components/AbstractPageReloadOverlay.js @@ -14,12 +14,11 @@ import { isFatalJitsiConnectionError } from '../../base/lib-jitsi-meet'; +import logger from '../logger'; import ReloadButton from './web/ReloadButton'; declare var APP: Object; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * The type of the React {@code Component} props of * {@link AbstractPageReloadOverlay}. diff --git a/react/features/overlay/logger.js b/react/features/overlay/logger.js new file mode 100644 index 000000000..292e81403 --- /dev/null +++ b/react/features/overlay/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/overlay'); diff --git a/react/features/recent-list/logger.js b/react/features/recent-list/logger.js new file mode 100644 index 000000000..adbe50e98 --- /dev/null +++ b/react/features/recent-list/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/recent-list'); diff --git a/react/features/recent-list/reducer.js b/react/features/recent-list/reducer.js index ae877782b..6bbec3aef 100644 --- a/react/features/recent-list/reducer.js +++ b/react/features/recent-list/reducer.js @@ -10,8 +10,7 @@ import { DELETE_RECENT_LIST_ENTRY } from './actionTypes'; import { isRecentListEnabled } from './functions'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * The default/initial redux state of the feature {@code recent-list}. diff --git a/react/features/recording/components/LiveStream/native/GoogleSigninForm.js b/react/features/recording/components/LiveStream/native/GoogleSigninForm.js index 3d261819b..6f0249aef 100644 --- a/react/features/recording/components/LiveStream/native/GoogleSigninForm.js +++ b/react/features/recording/components/LiveStream/native/GoogleSigninForm.js @@ -16,9 +16,9 @@ import { setGoogleAPIState } from '../../../../google-api'; -import styles from './styles'; +import logger from '../../../logger'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import styles from './styles'; /** * Prop type of the component {@code GoogleSigninForm}. diff --git a/react/features/recording/logger.js b/react/features/recording/logger.js new file mode 100644 index 000000000..51debcd1c --- /dev/null +++ b/react/features/recording/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/recording'); diff --git a/react/features/room-lock/logger.js b/react/features/room-lock/logger.js new file mode 100644 index 000000000..de6b3916e --- /dev/null +++ b/react/features/room-lock/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/room-lock'); diff --git a/react/features/room-lock/middleware.js b/react/features/room-lock/middleware.js index 34cb36827..da022e2ed 100644 --- a/react/features/room-lock/middleware.js +++ b/react/features/room-lock/middleware.js @@ -17,11 +17,10 @@ import UIEvents from '../../../service/UI/UIEvents'; import { _openPasswordRequiredPrompt } from './actions'; import { PasswordRequiredPrompt, RoomLockPrompt } from './components'; import { LOCKED_REMOTELY } from './constants'; +import logger from './logger'; declare var APP: Object; -const logger = require('jitsi-meet-logger').getLogger(__filename); - /** * Middleware that captures conference failed and checks for password required * error and requests a dialog for user to enter password. diff --git a/react/features/settings/components/web/CalendarTab.js b/react/features/settings/components/web/CalendarTab.js index 65420742c..4934a07c9 100644 --- a/react/features/settings/components/web/CalendarTab.js +++ b/react/features/settings/components/web/CalendarTab.js @@ -16,7 +16,7 @@ import { } from '../../../calendar-sync'; import { GoogleSignInButton } from '../../../google-api'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from '../../logger'; declare var interfaceConfig: Object; diff --git a/react/features/settings/logger.js b/react/features/settings/logger.js new file mode 100644 index 000000000..110e3b553 --- /dev/null +++ b/react/features/settings/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/settings'); diff --git a/react/features/share-room/logger.js b/react/features/share-room/logger.js new file mode 100644 index 000000000..d376fe181 --- /dev/null +++ b/react/features/share-room/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/share-room'); diff --git a/react/features/share-room/middleware.js b/react/features/share-room/middleware.js index 23a5d7e01..09c27eb51 100644 --- a/react/features/share-room/middleware.js +++ b/react/features/share-room/middleware.js @@ -8,8 +8,7 @@ import { getShareInfoText } from '../invite'; import { endShareRoom } from './actions'; import { BEGIN_SHARE_ROOM } from './actionTypes'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * Middleware that captures room URL sharing actions and starts the sharing diff --git a/react/features/subtitles/logger.js b/react/features/subtitles/logger.js new file mode 100644 index 000000000..9bf7ce740 --- /dev/null +++ b/react/features/subtitles/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/subtitles'); diff --git a/react/features/subtitles/middleware.js b/react/features/subtitles/middleware.js index 1017a46ff..30198de5d 100644 --- a/react/features/subtitles/middleware.js +++ b/react/features/subtitles/middleware.js @@ -10,8 +10,7 @@ import { ENDPOINT_MESSAGE_RECEIVED, TOGGLE_REQUESTING_SUBTITLES } from './actionTypes'; - -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from './logger'; /** * The type of json-message which indicates that json carries a diff --git a/react/features/video-layout/components/TileViewButton.js b/react/features/video-layout/components/TileViewButton.js index 5e5127195..e5272ce70 100644 --- a/react/features/video-layout/components/TileViewButton.js +++ b/react/features/video-layout/components/TileViewButton.js @@ -1,6 +1,5 @@ // @flow -import Logger from 'jitsi-meet-logger'; import type { Dispatch } from 'redux'; import { @@ -15,8 +14,7 @@ import { } from '../../base/toolbox'; import { setTileView } from '../actions'; - -const logger = Logger.getLogger(__filename); +import logger from '../logger'; /** * The type of the React {@code Component} props of {@link TileViewButton}. diff --git a/react/features/video-layout/logger.js b/react/features/video-layout/logger.js new file mode 100644 index 000000000..d03405939 --- /dev/null +++ b/react/features/video-layout/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/video-layout'); diff --git a/react/features/video-quality/components/VideoQualitySlider.web.js b/react/features/video-quality/components/VideoQualitySlider.web.js index 911d5d56a..d8f948d3c 100644 --- a/react/features/video-quality/components/VideoQualitySlider.web.js +++ b/react/features/video-quality/components/VideoQualitySlider.web.js @@ -11,7 +11,7 @@ import { translate } from '../../base/i18n'; import JitsiMeetJS from '../../base/lib-jitsi-meet'; import { connect } from '../../base/redux'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +import logger from '../logger'; const { HIGH, diff --git a/react/features/video-quality/logger.js b/react/features/video-quality/logger.js new file mode 100644 index 000000000..d19b7aee8 --- /dev/null +++ b/react/features/video-quality/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/video-quality'); diff --git a/react/features/videosipgw/logger.js b/react/features/videosipgw/logger.js new file mode 100644 index 000000000..2eb6d516b --- /dev/null +++ b/react/features/videosipgw/logger.js @@ -0,0 +1,5 @@ +// @flow + +import { getLogger } from '../base/logging/functions'; + +export default getLogger('features/videosipgw'); diff --git a/react/features/videosipgw/middleware.js b/react/features/videosipgw/middleware.js index f44c02de4..6789a2f9c 100644 --- a/react/features/videosipgw/middleware.js +++ b/react/features/videosipgw/middleware.js @@ -1,11 +1,6 @@ -/* @flow */ +// @flow -import Logger from 'jitsi-meet-logger'; import { CONFERENCE_WILL_JOIN } from '../base/conference'; -import { - SIP_GW_AVAILABILITY_CHANGED, - SIP_GW_INVITE_ROOMS -} from './actionTypes'; import { JitsiConferenceEvents, JitsiSIPVideoGWStatus @@ -17,7 +12,11 @@ import { showWarningNotification } from '../notifications'; -const logger = Logger.getLogger(__filename); +import { + SIP_GW_AVAILABILITY_CHANGED, + SIP_GW_INVITE_ROOMS +} from './actionTypes'; +import logger from './logger'; /** * Middleware that captures conference video sip gw events and stores diff --git a/react/index.web.js b/react/index.web.js index b03875520..2e8d8dec7 100644 --- a/react/index.web.js +++ b/react/index.web.js @@ -6,9 +6,10 @@ import ReactDOM from 'react-dom'; import { getJitsiMeetTransport } from '../modules/transport'; import { App } from './features/app'; +import { getLogger } from './features/base/logging/functions'; import { Platform } from './features/base/react'; -const logger = require('jitsi-meet-logger').getLogger(__filename); +const logger = getLogger('index.web'); const OS = Platform.OS; /**