Переглянути джерело

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 роки тому
джерело
коміт
90451a640c
1 змінених файлів з 9 додано та 6 видалено
  1. 9
    6
      react/features/base/logging/middleware.js

+ 9
- 6
react/features/base/logging/middleware.js Переглянути файл

119
  * specified {@code action}.
119
  * specified {@code action}.
120
  */
120
  */
121
 function _setLoggingConfig({ getState }, next, action) {
121
 function _setLoggingConfig({ getState }, next, action) {
122
-    const oldValue = getState()['features/base/logging'].config;
123
     const result = next(action);
122
     const result = next(action);
124
     const newValue = getState()['features/base/logging'].config;
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
     return result;
136
     return result;
134
 }
137
 }

Завантаження…
Відмінити
Зберегти