Ver código fonte

Fixes sending logs to callstats.

When _setLoggingConfig is invoked for the first time old and new config
are equal and _initLogging is not called. Currently, there is no way to
detect when the first time we call it is. We could use APP.logCollector
but it should go away at some point in the future.
j8
damencho 8 anos atrás
pai
commit
90451a640c
1 arquivos alterados com 9 adições e 6 exclusões
  1. 9
    6
      react/features/base/logging/middleware.js

+ 9
- 6
react/features/base/logging/middleware.js Ver arquivo

@@ -119,16 +119,19 @@ function _libWillInit({ getState }, next, action) {
119 119
  * specified {@code action}.
120 120
  */
121 121
 function _setLoggingConfig({ getState }, next, action) {
122
-    const oldValue = getState()['features/base/logging'].config;
123 122
     const result = next(action);
124 123
     const newValue = getState()['features/base/logging'].config;
125 124
 
126
-    if (oldValue !== newValue) {
127
-        _setLogLevels(Logger, newValue);
128
-        _setLogLevels(JitsiMeetJS, newValue);
125
+    // TODO Generally, we'll want to _setLogLevels and _initLogging only if the
126
+    // logging config values actually change.
127
+    // XXX Unfortunately, we don't currently have a (nice) way of determining
128
+    // whether _setLogLevels or _initLogging have been invoked so we have to
129
+    // invoke them unconditionally even if none of the values have actually
130
+    // changed.
131
+    _setLogLevels(Logger, newValue);
132
+    _setLogLevels(JitsiMeetJS, newValue);
129 133
 
130
-        _initLogging(newValue);
131
-    }
134
+    _initLogging(newValue);
132 135
 
133 136
     return result;
134 137
 }

Carregando…
Cancelar
Salvar