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.
This commit is contained in:
Saúl Ibarra Corretgé 2019-09-06 13:02:39 +02:00 committed by Saúl Ibarra Corretgé
parent 2ccd4968a4
commit f863733dd3
4 changed files with 2 additions and 18 deletions

View File

@ -1,7 +1,5 @@
// @flow // @flow
import logger from './logger';
/** /**
* Creates a deferred object. * Creates a deferred object.
* *
@ -106,6 +104,6 @@ export function assignIfDefined(target: Object, source: Object) {
* @returns {void} * @returns {void}
*/ */
export function reportError(e: Object, msg: string = '') { export function reportError(e: Object, msg: string = '') {
logger.error(msg, e); console.error(msg, e);
window.onerror && window.onerror(msg, null, null, null, e); window.onerror && window.onerror(msg, null, null, null, e);
} }

View File

@ -1,7 +1,5 @@
import { timeoutPromise } from './timeoutPromise'; import { timeoutPromise } from './timeoutPromise';
import logger from './logger';
/** /**
* The number of milliseconds before deciding that we need retry a fetch request. * The number of milliseconds before deciding that we need retry a fetch request.
* *
@ -29,11 +27,6 @@ export function doGetJSON(url, retry) {
return jsonify return jsonify
.then(result => Promise.reject(result)); .then(result => Promise.reject(result));
})
.catch(error => {
logger.error('Error performing get:', url, error);
return Promise.reject(error);
}); });
if (retry) { if (retry) {

View File

@ -1,5 +0,0 @@
// @flow
import { getLogger } from '../logging/functions';
export default getLogger('features/base/util');

View File

@ -1,7 +1,5 @@
// @flow // @flow
import logger from './logger';
/** /**
* The app linking scheme. * The app linking scheme.
* TODO: This should be read from the manifest files later. * TODO: This should be read from the manifest files later.
@ -133,7 +131,7 @@ function _objectToURLParamsArray(obj = {}) {
params.push( params.push(
`${key}=${encodeURIComponent(JSON.stringify(obj[key]))}`); `${key}=${encodeURIComponent(JSON.stringify(obj[key]))}`);
} catch (e) { } catch (e) {
logger.warn(`Error encoding ${key}: ${e}`); console.warn(`Error encoding ${key}: ${e}`);
} }
} }