diff --git a/logging_config.js b/logging_config.js index 0e0b9fdaa..ffdb6052d 100644 --- a/logging_config.js +++ b/logging_config.js @@ -1,7 +1,6 @@ /* eslint-disable no-unused-vars, no-var */ + // Logging configuration -// XXX When making any changes to this file make sure to also update it's React -// version at ./react/features/base/logging/reducer.js !!! var loggingConfig = { // default log level for the app and lib-jitsi-meet defaultLogLevel: 'trace', @@ -11,9 +10,17 @@ var loggingConfig = { // The following are too verbose in their logging with the // {@link #defaultLogLevel}: + 'modules/RTC/TraceablePeerConnection.js': 'info', 'modules/statistics/CallStats.js': 'info', - 'modules/xmpp/strophe.util.js': 'log', - 'modules/RTC/TraceablePeerConnection.js': 'info' + 'modules/xmpp/strophe.util.js': 'log' }; /* eslint-enable no-unused-vars, no-var */ + +// XXX Web/React server-includes logging_config.js into index.html. +// Mobile/react-native requires it in react/features/base/logging. For the +// purposes of the latter, (try to) export loggingConfig. The following +// detection of a module system is inspired by webpack. +typeof module === 'object' + && typeof exports === 'object' + && (module.exports = loggingConfig); diff --git a/react/features/base/logging/reducer.js b/react/features/base/logging/reducer.js index 4b97b7539..ec53f014d 100644 --- a/react/features/base/logging/reducer.js +++ b/react/features/base/logging/reducer.js @@ -7,23 +7,12 @@ import { SET_LOGGING_CONFIG } from './actionTypes'; /** * The default/initial redux state of the feature base/logging. * - * XXX When making any changes to the DEFAULT_STATE make sure to also update - * logging_config.js file located in the root directory of this project !!! - * * @type {{ * config: Object * }} */ const DEFAULT_STATE = { - config: { - defaultLogLevel: 'trace', - - // The following are too verbose in their logging with the - // {@link #defaultLogLevel}: - 'modules/statistics/CallStats.js': 'info', - 'modules/xmpp/strophe.util.js': 'log', - 'modules/RTC/TraceablePeerConnection.js': 'info' - } + config: require('../../../../logging_config.js') }; ReducerRegistry.register(