Procházet zdrojové kódy

Remove duplication

master
Lyubo Marinov před 6 roky
rodič
revize
0892e0b644
2 změnil soubory, kde provedl 12 přidání a 16 odebrání
  1. 11
    4
      logging_config.js
  2. 1
    12
      react/features/base/logging/reducer.js

+ 11
- 4
logging_config.js Zobrazit soubor

@@ -1,7 +1,6 @@
1 1
 /* eslint-disable no-unused-vars, no-var */
2
+
2 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 4
 var loggingConfig = {
6 5
     // default log level for the app and lib-jitsi-meet
7 6
     defaultLogLevel: 'trace',
@@ -11,9 +10,17 @@ var loggingConfig = {
11 10
 
12 11
     // The following are too verbose in their logging with the
13 12
     // {@link #defaultLogLevel}:
13
+    'modules/RTC/TraceablePeerConnection.js': 'info',
14 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 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 Zobrazit soubor

@@ -7,23 +7,12 @@ import { SET_LOGGING_CONFIG } from './actionTypes';
7 7
 /**
8 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 10
  * @type {{
14 11
  *     config: Object
15 12
  * }}
16 13
  */
17 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 18
 ReducerRegistry.register(

Načítá se…
Zrušit
Uložit