Pārlūkot izejas kodu

Replace console with logger

j8
Bettenbuk Zoltan 6 gadus atpakaļ
vecāks
revīzija
b41bf22be7

+ 2
- 1
react/features/always-on-top/AudioMuteButton.js Parādīt failu

@@ -4,6 +4,7 @@ import { AbstractAudioMuteButton } from '../base/toolbox';
4 4
 import type { AbstractButtonProps as Props } from '../base/toolbox';
5 5
 
6 6
 const { api } = window.alwaysOnTop;
7
+const logger = require('jitsi-meet-logger').getLogger(__filename);
7 8
 
8 9
 /**
9 10
  * The type of the React {@code Component} state of {@link AudioMuteButton}.
@@ -68,7 +69,7 @@ export default class AudioMuteButton
68 69
                     audioAvailable,
69 70
                     audioMuted
70 71
                 }))
71
-            .catch(console.error);
72
+            .catch(logger.error);
72 73
     }
73 74
 
74 75
     /**

+ 2
- 1
react/features/always-on-top/VideoMuteButton.js Parādīt failu

@@ -4,6 +4,7 @@ import { AbstractVideoMuteButton } from '../base/toolbox';
4 4
 import type { AbstractButtonProps as Props } from '../base/toolbox';
5 5
 
6 6
 const { api } = window.alwaysOnTop;
7
+const logger = require('jitsi-meet-logger').getLogger(__filename);
7 8
 
8 9
 /**
9 10
  * The type of the React {@code Component} state of {@link VideoMuteButton}.
@@ -68,7 +69,7 @@ export default class VideoMuteButton
68 69
                     videoAvailable,
69 70
                     videoMuted
70 71
                 }))
71
-            .catch(console.error);
72
+            .catch(logger.error);
72 73
     }
73 74
 
74 75
     /**

+ 3
- 1
react/features/app/components/App.native.js Parādīt failu

@@ -26,6 +26,8 @@ import type { Props as AbstractAppProps } from './AbstractApp';
26 26
 
27 27
 declare var __DEV__;
28 28
 
29
+const logger = require('jitsi-meet-logger').getLogger(__filename);
30
+
29 31
 /**
30 32
  * The type of React {@code Component} props of {@link App}.
31 33
  */
@@ -196,7 +198,7 @@ function _handleException(error, fatal) {
196 198
         // an unhandled JavascriptException for an unhandled JavaScript error.
197 199
         // This will effectively kill the app. In accord with the Web, do not
198 200
         // kill the app.
199
-        console.error(error);
201
+        logger.error(error);
200 202
     } else {
201 203
         // Forward to the next globalHandler of ErrorUtils.
202 204
         const { next } = _handleException;

+ 3
- 1
react/features/base/conference/functions.js Parādīt failu

@@ -11,6 +11,8 @@ import {
11 11
     JITSI_CONFERENCE_URL_KEY
12 12
 } from './constants';
13 13
 
14
+const logger = require('jitsi-meet-logger').getLogger(__filename);
15
+
14 16
 /**
15 17
  * Attach a set of local tracks to a conference.
16 18
  *
@@ -172,7 +174,7 @@ export function _removeLocalTracksFromConference(
172 174
 function _reportError(msg, err) {
173 175
     // TODO This is a good point to call some global error handler when we have
174 176
     // one.
175
-    console.error(msg, err);
177
+    logger.error(msg, err);
176 178
 }
177 179
 
178 180
 /**

+ 1
- 1
react/features/base/conference/middleware.js Parādīt failu

@@ -493,7 +493,7 @@ function _setLastN({ getState }, next, action) {
493 493
         try {
494 494
             conference.setLastN(action.lastN);
495 495
         } catch (err) {
496
-            console.error(`Failed to set lastN: ${err}`);
496
+            logger.error(`Failed to set lastN: ${err}`);
497 497
         }
498 498
     }
499 499
 

+ 3
- 1
react/features/base/lib-jitsi-meet/functions.js Parādīt failu

@@ -10,6 +10,8 @@ declare var APP: Object;
10 10
 const JitsiConferenceErrors = JitsiMeetJS.errors.conference;
11 11
 const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
12 12
 
13
+const logger = require('jitsi-meet-logger').getLogger(__filename);
14
+
13 15
 /**
14 16
  * Creates a {@link JitsiLocalTrack} model from the given device id.
15 17
  *
@@ -133,7 +135,7 @@ export function loadConfig(
133 135
                     return config;
134 136
                 })
135 137
                 .catch(err => {
136
-                    console.error(`Failed to load config from ${url}`, err);
138
+                    logger.error(`Failed to load config from ${url}`, err);
137 139
 
138 140
                     throw err;
139 141
                 });

+ 3
- 1
react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js Parādīt failu

@@ -3,6 +3,8 @@
3 3
 import { NativeModules } from 'react-native';
4 4
 import { RTCPeerConnection, RTCSessionDescription } from 'react-native-webrtc';
5 5
 
6
+const logger = require('jitsi-meet-logger').getLogger(__filename);
7
+
6 8
 /* eslint-disable no-unused-vars */
7 9
 
8 10
 // Address families.
@@ -140,7 +142,7 @@ _RTCPeerConnection.prototype.setRemoteDescription = function(
140 142
  * @returns {void}
141 143
  */
142 144
 function _LOGE(...args) {
143
-    console && console.error && console.error(...args);
145
+    logger.error(...args);
144 146
 }
145 147
 
146 148
 /**

+ 1
- 1
react/features/base/tracks/functions.js Parādīt failu

@@ -233,7 +233,7 @@ export function setTrackMuted(track, muted) {
233 233
         // Track might be already disposed so ignore such an error.
234 234
         if (error.name !== JitsiTrackErrors.TRACK_IS_DISPOSED) {
235 235
             // FIXME Emit mute failed, so that the app can show error dialog.
236
-            console.error(`set track ${f} failed`, error);
236
+            logger.error(`set track ${f} failed`, error);
237 237
         }
238 238
     });
239 239
 }

+ 3
- 1
react/features/base/util/uri.js Parādīt failu

@@ -1,5 +1,7 @@
1 1
 // @flow
2 2
 
3
+const logger = require('jitsi-meet-logger').getLogger(__filename);
4
+
3 5
 /**
4 6
  * The app linking scheme.
5 7
  * TODO: This should be read from the manifest files later.
@@ -174,7 +176,7 @@ function _objectToURLParamsArray(obj = {}) {
174 176
             params.push(
175 177
                 `${key}=${encodeURIComponent(JSON.stringify(obj[key]))}`);
176 178
         } catch (e) {
177
-            console.warn(`Error encoding ${key}: ${e}`);
179
+            logger.warn(`Error encoding ${key}: ${e}`);
178 180
         }
179 181
     }
180 182
 

+ 4
- 3
react/features/mobile/audio-mode/middleware.js Parādīt failu

@@ -1,4 +1,4 @@
1
-/* @flow */
1
+// @flow
2 2
 
3 3
 import { NativeModules } from 'react-native';
4 4
 
@@ -11,7 +11,8 @@ import {
11 11
 } from '../../base/conference';
12 12
 import { MiddlewareRegistry } from '../../base/redux';
13 13
 
14
-const AudioMode = NativeModules.AudioMode;
14
+const { AudioMode } = NativeModules;
15
+const logger = require('jitsi-meet-logger').getLogger(__filename);
15 16
 
16 17
 /**
17 18
  * Middleware that captures conference actions and sets the correct audio mode
@@ -59,7 +60,7 @@ MiddlewareRegistry.register(({ getState }) => next => action => {
59 60
         if (typeof mode !== 'undefined') {
60 61
             AudioMode.setMode(mode)
61 62
                 .catch(err =>
62
-                    console.error(
63
+                    logger.error(
63 64
                         `Failed to set audio mode ${String(mode)}: ${err}`));
64 65
         }
65 66
     }

+ 3
- 1
react/features/mobile/picture-in-picture/actions.js Parādīt failu

@@ -7,6 +7,8 @@ import { Platform } from '../../base/react';
7 7
 
8 8
 import { ENTER_PICTURE_IN_PICTURE } from './actionTypes';
9 9
 
10
+const logger = require('jitsi-meet-logger').getLogger(__filename);
11
+
10 12
 /**
11 13
  * Enters (or rather initiates entering) picture-in-picture.
12 14
  * Helper function to enter PiP mode. This is triggered by user request
@@ -34,7 +36,7 @@ export function enterPictureInPicture() {
34 36
 
35 37
             p.then(
36 38
                 () => dispatch({ type: ENTER_PICTURE_IN_PICTURE }),
37
-                e => console.warn(`Error entering PiP mode: ${e}`));
39
+                e => logger.warn(`Error entering PiP mode: ${e}`));
38 40
         }
39 41
     };
40 42
 }

+ 3
- 1
react/features/share-room/middleware.js Parādīt failu

@@ -8,6 +8,8 @@ import { MiddlewareRegistry } from '../base/redux';
8 8
 import { endShareRoom } from './actions';
9 9
 import { BEGIN_SHARE_ROOM } from './actionTypes';
10 10
 
11
+const logger = require('jitsi-meet-logger').getLogger(__filename);
12
+
11 13
 /**
12 14
  * Middleware that captures room URL sharing actions and starts the sharing
13 15
  * process.
@@ -56,7 +58,7 @@ function _shareRoom(roomURL: string, dispatch: Function) {
56 58
                 onFulfilled(value.action === Share.sharedAction);
57 59
             },
58 60
             /* onRejected */ reason => {
59
-                console.error(
61
+                logger.error(
60 62
                     `Failed to share conference/room URL ${roomURL}:`,
61 63
                     reason);
62 64
                 onFulfilled(false);

+ 3
- 1
react/index.native.js Parādīt failu

@@ -21,6 +21,8 @@ import { App } from './features/app';
21 21
 import { equals } from './features/base/redux';
22 22
 import { IncomingCallApp } from './features/mobile/incoming-call';
23 23
 
24
+const logger = require('jitsi-meet-logger').getLogger(__filename);
25
+
24 26
 /**
25 27
  * The type of the React {@code Component} props of {@link Root}.
26 28
  */
@@ -74,7 +76,7 @@ class Root extends Component<Props, State> {
74 76
                     }
75 77
                 })
76 78
                 .catch(err => {
77
-                    console.error('Failed to get initial URL', err);
79
+                    logger.error('Failed to get initial URL', err);
78 80
 
79 81
                     if (typeof this.state.url === 'undefined') {
80 82
                         // Start with an empty URL if getting the initial URL

Notiek ielāde…
Atcelt
Saglabāt