From bf1512685c06aed307b3a7dcf3a2613e69782680 Mon Sep 17 00:00:00 2001 From: Kuitos Date: Tue, 18 Feb 2020 20:51:28 +0800 Subject: [PATCH] :loud_sound: disable logging by default --- src/cacheAdapterEnhancer.ts | 4 ++-- src/retryAdapterEnhancer.ts | 4 ++-- src/throttleAdapterEnhancer.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cacheAdapterEnhancer.ts b/src/cacheAdapterEnhancer.ts index e4b590d..dac909b 100644 --- a/src/cacheAdapterEnhancer.ts +++ b/src/cacheAdapterEnhancer.ts @@ -69,9 +69,9 @@ export default function cacheAdapterEnhancer(adapter: AxiosAdapter, options: Opt } /* istanbul ignore next */ - if (process.env.NODE_ENV === 'development' || process.env.LOGGER_LEVEL === 'info') { + if (process.env.LOGGER_LEVEL === 'info') { // eslint-disable-next-line no-console - console.info(`request cached by cache adapter: ${index}`); + console.info(`[axios-extensions] request cached by cache adapter --> url: ${index}`); } return responsePromise; diff --git a/src/retryAdapterEnhancer.ts b/src/retryAdapterEnhancer.ts index 55e171c..a011468 100644 --- a/src/retryAdapterEnhancer.ts +++ b/src/retryAdapterEnhancer.ts @@ -31,8 +31,8 @@ export default function retryAdapterEnhancer(adapter: AxiosAdapter, options: Opt count++; /* istanbul ignore next */ - if (process.env.NODE_ENV === 'development' || process.env.LOGGER_LEVEL === 'info') { - console.info(`request ${config.url} start retrying at time ${count}`); + if (process.env.LOGGER_LEVEL === 'info') { + console.info(`[axios-extensions] request start retrying --> url: ${config.url} , time: ${count}`); } return request(); diff --git a/src/throttleAdapterEnhancer.ts b/src/throttleAdapterEnhancer.ts index c13261b..ee1ee10 100644 --- a/src/throttleAdapterEnhancer.ts +++ b/src/throttleAdapterEnhancer.ts @@ -68,9 +68,9 @@ export default function throttleAdapterEnhancer(adapter: AxiosAdapter, options: if (responsePromise) { /* istanbul ignore next */ - if (process.env.NODE_ENV === 'development' || process.env.LOGGER_LEVEL === 'info') { + if (process.env.LOGGER_LEVEL === 'info') { // eslint-disable-next-line no-console - console.info(`request cached by throttle adapter: ${index}`); + console.info(`[axios-extensions] request cached by throttle adapter --> url: ${index}`); } return responsePromise;