Bläddra i källkod

fix(rn,logging) skip some logs on mobile

master
Saúl Ibarra Corretgé 3 år sedan
förälder
incheckning
7b4a426ad2
1 ändrade filer med 19 tillägg och 2 borttagningar
  1. 19
    2
      react/features/base/logging/reducer.js

+ 19
- 2
react/features/base/logging/reducer.js Visa fil

@@ -4,6 +4,9 @@ import { equals, ReducerRegistry, set } from '../redux';
4 4
 
5 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 11
  * The default/initial redux state of the feature base/logging.
9 12
  *
@@ -12,8 +15,7 @@ import { SET_LOG_COLLECTOR, SET_LOGGING_CONFIG } from './actionTypes';
12 15
  * }}
13 16
  */
14 17
 const DEFAULT_STATE = {
15
-    // eslint-disable-next-line
16
-    config: require('../../../../logging_config.js'),
18
+    config: LOGGING_CONFIG,
17 19
 
18 20
     /**
19 21
      * The log collector.
@@ -21,6 +23,21 @@ const DEFAULT_STATE = {
21 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 41
 ReducerRegistry.register(
25 42
     'features/base/logging',
26 43
     (state = DEFAULT_STATE, action) => {

Laddar…
Avbryt
Spara