From 90451a640caafc618e8e481dc18c0bc9e0c86237 Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 11 Oct 2017 13:14:37 -0500 Subject: [PATCH] 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. --- react/features/base/logging/middleware.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/react/features/base/logging/middleware.js b/react/features/base/logging/middleware.js index 0507f6af7..ef602ca73 100644 --- a/react/features/base/logging/middleware.js +++ b/react/features/base/logging/middleware.js @@ -119,16 +119,19 @@ function _libWillInit({ getState }, next, action) { * specified {@code action}. */ function _setLoggingConfig({ getState }, next, action) { - const oldValue = getState()['features/base/logging'].config; const result = next(action); const newValue = getState()['features/base/logging'].config; - if (oldValue !== newValue) { - _setLogLevels(Logger, newValue); - _setLogLevels(JitsiMeetJS, newValue); + // TODO Generally, we'll want to _setLogLevels and _initLogging only if the + // logging config values actually change. + // XXX Unfortunately, we don't currently have a (nice) way of determining + // whether _setLogLevels or _initLogging have been invoked so we have to + // invoke them unconditionally even if none of the values have actually + // changed. + _setLogLevels(Logger, newValue); + _setLogLevels(JitsiMeetJS, newValue); - _initLogging(newValue); - } + _initLogging(newValue); return result; }