fix(rn,logging) skip some logs on mobile
This commit is contained in:
parent
a687907105
commit
7b4a426ad2
|
@ -4,6 +4,9 @@ import { equals, ReducerRegistry, set } from '../redux';
|
||||||
|
|
||||||
import { SET_LOG_COLLECTOR, SET_LOGGING_CONFIG } from './actionTypes';
|
import { SET_LOG_COLLECTOR, SET_LOGGING_CONFIG } from './actionTypes';
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
|
const LOGGING_CONFIG = require('../../../../logging_config.js');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default/initial redux state of the feature base/logging.
|
* The default/initial redux state of the feature base/logging.
|
||||||
*
|
*
|
||||||
|
@ -12,8 +15,7 @@ import { SET_LOG_COLLECTOR, SET_LOGGING_CONFIG } from './actionTypes';
|
||||||
* }}
|
* }}
|
||||||
*/
|
*/
|
||||||
const DEFAULT_STATE = {
|
const DEFAULT_STATE = {
|
||||||
// eslint-disable-next-line
|
config: LOGGING_CONFIG,
|
||||||
config: require('../../../../logging_config.js'),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The log collector.
|
* The log collector.
|
||||||
|
@ -21,6 +23,21 @@ const DEFAULT_STATE = {
|
||||||
logCollector: undefined
|
logCollector: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Reduce verbosity on mobile, it kills performance.
|
||||||
|
if (navigator.product === 'ReactNative') {
|
||||||
|
const RN_LOGGING_CONFIG = {
|
||||||
|
'modules/sdp/SDPUtil.js': 'info',
|
||||||
|
'modules/xmpp/ChatRoom.js': 'warn',
|
||||||
|
'modules/xmpp/JingleSessionPC.js': 'info',
|
||||||
|
'modules/xmpp/strophe.jingle.js': 'info'
|
||||||
|
};
|
||||||
|
|
||||||
|
DEFAULT_STATE.config = {
|
||||||
|
...LOGGING_CONFIG,
|
||||||
|
...RN_LOGGING_CONFIG
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
ReducerRegistry.register(
|
ReducerRegistry.register(
|
||||||
'features/base/logging',
|
'features/base/logging',
|
||||||
(state = DEFAULT_STATE, action) => {
|
(state = DEFAULT_STATE, action) => {
|
||||||
|
|
Loading…
Reference in New Issue