Skip to content

Commit

Permalink
🔊 disable logging by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos committed Feb 18, 2020
1 parent be85d5e commit bf15126
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cacheAdapterEnhancer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/retryAdapterEnhancer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/throttleAdapterEnhancer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bf15126

Please sign in to comment.