Sfoglia il codice sorgente

Remove duplication

j8
Lyubo Marinov 6 anni fa
parent
commit
0892e0b644
2 ha cambiato i file con 12 aggiunte e 16 eliminazioni
  1. 11
    4
      logging_config.js
  2. 1
    12
      react/features/base/logging/reducer.js

+ 11
- 4
logging_config.js Vedi File

1
 /* eslint-disable no-unused-vars, no-var */
1
 /* eslint-disable no-unused-vars, no-var */
2
+
2
 // Logging configuration
3
 // Logging configuration
3
-// XXX When making any changes to this file make sure to also update it's React
4
-// version at ./react/features/base/logging/reducer.js !!!
5
 var loggingConfig = {
4
 var loggingConfig = {
6
     // default log level for the app and lib-jitsi-meet
5
     // default log level for the app and lib-jitsi-meet
7
     defaultLogLevel: 'trace',
6
     defaultLogLevel: 'trace',
11
 
10
 
12
     // The following are too verbose in their logging with the
11
     // The following are too verbose in their logging with the
13
     // {@link #defaultLogLevel}:
12
     // {@link #defaultLogLevel}:
13
+    'modules/RTC/TraceablePeerConnection.js': 'info',
14
     'modules/statistics/CallStats.js': 'info',
14
     'modules/statistics/CallStats.js': 'info',
15
-    'modules/xmpp/strophe.util.js': 'log',
16
-    'modules/RTC/TraceablePeerConnection.js': 'info'
15
+    'modules/xmpp/strophe.util.js': 'log'
17
 };
16
 };
18
 
17
 
19
 /* eslint-enable no-unused-vars, no-var */
18
 /* eslint-enable no-unused-vars, no-var */
19
+
20
+// XXX Web/React server-includes logging_config.js into index.html.
21
+// Mobile/react-native requires it in react/features/base/logging. For the
22
+// purposes of the latter, (try to) export loggingConfig. The following
23
+// detection of a module system is inspired by webpack.
24
+typeof module === 'object'
25
+    && typeof exports === 'object'
26
+    && (module.exports = loggingConfig);

+ 1
- 12
react/features/base/logging/reducer.js Vedi File

7
 /**
7
 /**
8
  * The default/initial redux state of the feature base/logging.
8
  * The default/initial redux state of the feature base/logging.
9
  *
9
  *
10
- * XXX When making any changes to the DEFAULT_STATE make sure to also update
11
- * logging_config.js file located in the root directory of this project !!!
12
- *
13
  * @type {{
10
  * @type {{
14
  *     config: Object
11
  *     config: Object
15
  * }}
12
  * }}
16
  */
13
  */
17
 const DEFAULT_STATE = {
14
 const DEFAULT_STATE = {
18
-    config: {
19
-        defaultLogLevel: 'trace',
20
-
21
-        // The following are too verbose in their logging with the
22
-        // {@link #defaultLogLevel}:
23
-        'modules/statistics/CallStats.js': 'info',
24
-        'modules/xmpp/strophe.util.js': 'log',
25
-        'modules/RTC/TraceablePeerConnection.js': 'info'
26
-    }
15
+    config: require('../../../../logging_config.js')
27
 };
16
 };
28
 
17
 
29
 ReducerRegistry.register(
18
 ReducerRegistry.register(

Loading…
Annulla
Salva