浏览代码

Replace console with logger

master
Bettenbuk Zoltan 6 年前
父节点
当前提交
b41bf22be7

+ 2
- 1
react/features/always-on-top/AudioMuteButton.js 查看文件

4
 import type { AbstractButtonProps as Props } from '../base/toolbox';
4
 import type { AbstractButtonProps as Props } from '../base/toolbox';
5
 
5
 
6
 const { api } = window.alwaysOnTop;
6
 const { api } = window.alwaysOnTop;
7
+const logger = require('jitsi-meet-logger').getLogger(__filename);
7
 
8
 
8
 /**
9
 /**
9
  * The type of the React {@code Component} state of {@link AudioMuteButton}.
10
  * The type of the React {@code Component} state of {@link AudioMuteButton}.
68
                     audioAvailable,
69
                     audioAvailable,
69
                     audioMuted
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 查看文件

4
 import type { AbstractButtonProps as Props } from '../base/toolbox';
4
 import type { AbstractButtonProps as Props } from '../base/toolbox';
5
 
5
 
6
 const { api } = window.alwaysOnTop;
6
 const { api } = window.alwaysOnTop;
7
+const logger = require('jitsi-meet-logger').getLogger(__filename);
7
 
8
 
8
 /**
9
 /**
9
  * The type of the React {@code Component} state of {@link VideoMuteButton}.
10
  * The type of the React {@code Component} state of {@link VideoMuteButton}.
68
                     videoAvailable,
69
                     videoAvailable,
69
                     videoMuted
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 查看文件

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

+ 3
- 1
react/features/base/conference/functions.js 查看文件

11
     JITSI_CONFERENCE_URL_KEY
11
     JITSI_CONFERENCE_URL_KEY
12
 } from './constants';
12
 } from './constants';
13
 
13
 
14
+const logger = require('jitsi-meet-logger').getLogger(__filename);
15
+
14
 /**
16
 /**
15
  * Attach a set of local tracks to a conference.
17
  * Attach a set of local tracks to a conference.
16
  *
18
  *
172
 function _reportError(msg, err) {
174
 function _reportError(msg, err) {
173
     // TODO This is a good point to call some global error handler when we have
175
     // TODO This is a good point to call some global error handler when we have
174
     // one.
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 查看文件

493
         try {
493
         try {
494
             conference.setLastN(action.lastN);
494
             conference.setLastN(action.lastN);
495
         } catch (err) {
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 查看文件

10
 const JitsiConferenceErrors = JitsiMeetJS.errors.conference;
10
 const JitsiConferenceErrors = JitsiMeetJS.errors.conference;
11
 const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
11
 const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
12
 
12
 
13
+const logger = require('jitsi-meet-logger').getLogger(__filename);
14
+
13
 /**
15
 /**
14
  * Creates a {@link JitsiLocalTrack} model from the given device id.
16
  * Creates a {@link JitsiLocalTrack} model from the given device id.
15
  *
17
  *
133
                     return config;
135
                     return config;
134
                 })
136
                 })
135
                 .catch(err => {
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
                     throw err;
140
                     throw err;
139
                 });
141
                 });

+ 3
- 1
react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js 查看文件

3
 import { NativeModules } from 'react-native';
3
 import { NativeModules } from 'react-native';
4
 import { RTCPeerConnection, RTCSessionDescription } from 'react-native-webrtc';
4
 import { RTCPeerConnection, RTCSessionDescription } from 'react-native-webrtc';
5
 
5
 
6
+const logger = require('jitsi-meet-logger').getLogger(__filename);
7
+
6
 /* eslint-disable no-unused-vars */
8
 /* eslint-disable no-unused-vars */
7
 
9
 
8
 // Address families.
10
 // Address families.
140
  * @returns {void}
142
  * @returns {void}
141
  */
143
  */
142
 function _LOGE(...args) {
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 查看文件

233
         // Track might be already disposed so ignore such an error.
233
         // Track might be already disposed so ignore such an error.
234
         if (error.name !== JitsiTrackErrors.TRACK_IS_DISPOSED) {
234
         if (error.name !== JitsiTrackErrors.TRACK_IS_DISPOSED) {
235
             // FIXME Emit mute failed, so that the app can show error dialog.
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 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+const logger = require('jitsi-meet-logger').getLogger(__filename);
4
+
3
 /**
5
 /**
4
  * The app linking scheme.
6
  * The app linking scheme.
5
  * TODO: This should be read from the manifest files later.
7
  * TODO: This should be read from the manifest files later.
174
             params.push(
176
             params.push(
175
                 `${key}=${encodeURIComponent(JSON.stringify(obj[key]))}`);
177
                 `${key}=${encodeURIComponent(JSON.stringify(obj[key]))}`);
176
         } catch (e) {
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 查看文件

1
-/* @flow */
1
+// @flow
2
 
2
 
3
 import { NativeModules } from 'react-native';
3
 import { NativeModules } from 'react-native';
4
 
4
 
11
 } from '../../base/conference';
11
 } from '../../base/conference';
12
 import { MiddlewareRegistry } from '../../base/redux';
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
  * Middleware that captures conference actions and sets the correct audio mode
18
  * Middleware that captures conference actions and sets the correct audio mode
59
         if (typeof mode !== 'undefined') {
60
         if (typeof mode !== 'undefined') {
60
             AudioMode.setMode(mode)
61
             AudioMode.setMode(mode)
61
                 .catch(err =>
62
                 .catch(err =>
62
-                    console.error(
63
+                    logger.error(
63
                         `Failed to set audio mode ${String(mode)}: ${err}`));
64
                         `Failed to set audio mode ${String(mode)}: ${err}`));
64
         }
65
         }
65
     }
66
     }

+ 3
- 1
react/features/mobile/picture-in-picture/actions.js 查看文件

7
 
7
 
8
 import { ENTER_PICTURE_IN_PICTURE } from './actionTypes';
8
 import { ENTER_PICTURE_IN_PICTURE } from './actionTypes';
9
 
9
 
10
+const logger = require('jitsi-meet-logger').getLogger(__filename);
11
+
10
 /**
12
 /**
11
  * Enters (or rather initiates entering) picture-in-picture.
13
  * Enters (or rather initiates entering) picture-in-picture.
12
  * Helper function to enter PiP mode. This is triggered by user request
14
  * Helper function to enter PiP mode. This is triggered by user request
34
 
36
 
35
             p.then(
37
             p.then(
36
                 () => dispatch({ type: ENTER_PICTURE_IN_PICTURE }),
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 查看文件

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

+ 3
- 1
react/index.native.js 查看文件

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

正在加载...
取消
保存