From f863733dd301917e461984fda102f7ecd2e661eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 6 Sep 2019 13:02:39 +0200 Subject: [PATCH] base/util: don't use the Grand Unified Logger There are just a couple of logs in this feature, and it's included in bundles like external_api, which would bloat it due to cascaded dependencis. --- react/features/base/util/helpers.js | 4 +--- react/features/base/util/httpUtils.js | 7 ------- react/features/base/util/logger.js | 5 ----- react/features/base/util/uri.js | 4 +--- 4 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 react/features/base/util/logger.js diff --git a/react/features/base/util/helpers.js b/react/features/base/util/helpers.js index e7e870d30..2c2f07472 100644 --- a/react/features/base/util/helpers.js +++ b/react/features/base/util/helpers.js @@ -1,7 +1,5 @@ // @flow -import logger from './logger'; - /** * Creates a deferred object. * @@ -106,6 +104,6 @@ export function assignIfDefined(target: Object, source: Object) { * @returns {void} */ export function reportError(e: Object, msg: string = '') { - logger.error(msg, e); + console.error(msg, e); window.onerror && window.onerror(msg, null, null, null, e); } diff --git a/react/features/base/util/httpUtils.js b/react/features/base/util/httpUtils.js index 5479267c9..9dfa598dd 100644 --- a/react/features/base/util/httpUtils.js +++ b/react/features/base/util/httpUtils.js @@ -1,7 +1,5 @@ import { timeoutPromise } from './timeoutPromise'; -import logger from './logger'; - /** * The number of milliseconds before deciding that we need retry a fetch request. * @@ -29,11 +27,6 @@ export function doGetJSON(url, retry) { return jsonify .then(result => Promise.reject(result)); - }) - .catch(error => { - logger.error('Error performing get:', url, error); - - return Promise.reject(error); }); if (retry) { diff --git a/react/features/base/util/logger.js b/react/features/base/util/logger.js deleted file mode 100644 index 82d31be58..000000000 --- a/react/features/base/util/logger.js +++ /dev/null @@ -1,5 +0,0 @@ -// @flow - -import { getLogger } from '../logging/functions'; - -export default getLogger('features/base/util'); diff --git a/react/features/base/util/uri.js b/react/features/base/util/uri.js index 60d639391..bb292d8e2 100644 --- a/react/features/base/util/uri.js +++ b/react/features/base/util/uri.js @@ -1,7 +1,5 @@ // @flow -import logger from './logger'; - /** * The app linking scheme. * TODO: This should be read from the manifest files later. @@ -133,7 +131,7 @@ function _objectToURLParamsArray(obj = {}) { params.push( `${key}=${encodeURIComponent(JSON.stringify(obj[key]))}`); } catch (e) { - logger.warn(`Error encoding ${key}: ${e}`); + console.warn(`Error encoding ${key}: ${e}`); } }