소스 검색

fix(rn,logging) skip some logs on mobile

master
Saúl Ibarra Corretgé 3 년 전
부모
커밋
7b4a426ad2
1개의 변경된 파일19개의 추가작업 그리고 2개의 파일을 삭제
  1. 19
    2
      react/features/base/logging/reducer.js

+ 19
- 2
react/features/base/logging/reducer.js 파일 보기

4
 
4
 
5
 import { SET_LOG_COLLECTOR, SET_LOGGING_CONFIG } from './actionTypes';
5
 import { SET_LOG_COLLECTOR, SET_LOGGING_CONFIG } from './actionTypes';
6
 
6
 
7
+// eslint-disable-next-line
8
+const LOGGING_CONFIG = require('../../../../logging_config.js');
9
+
7
 /**
10
 /**
8
  * The default/initial redux state of the feature base/logging.
11
  * The default/initial redux state of the feature base/logging.
9
  *
12
  *
12
  * }}
15
  * }}
13
  */
16
  */
14
 const DEFAULT_STATE = {
17
 const DEFAULT_STATE = {
15
-    // eslint-disable-next-line
16
-    config: require('../../../../logging_config.js'),
18
+    config: LOGGING_CONFIG,
17
 
19
 
18
     /**
20
     /**
19
      * The log collector.
21
      * The log collector.
21
     logCollector: undefined
23
     logCollector: undefined
22
 };
24
 };
23
 
25
 
26
+// Reduce verbosity on mobile, it kills performance.
27
+if (navigator.product === 'ReactNative') {
28
+    const RN_LOGGING_CONFIG = {
29
+        'modules/sdp/SDPUtil.js': 'info',
30
+        'modules/xmpp/ChatRoom.js': 'warn',
31
+        'modules/xmpp/JingleSessionPC.js': 'info',
32
+        'modules/xmpp/strophe.jingle.js': 'info'
33
+    };
34
+
35
+    DEFAULT_STATE.config = {
36
+        ...LOGGING_CONFIG,
37
+        ...RN_LOGGING_CONFIG
38
+    };
39
+}
40
+
24
 ReducerRegistry.register(
41
 ReducerRegistry.register(
25
     'features/base/logging',
42
     'features/base/logging',
26
     (state = DEFAULT_STATE, action) => {
43
     (state = DEFAULT_STATE, action) => {

Loading…
취소
저장