Skip to content

Commit bf15126

Browse files
committed
🔊 disable logging by default
1 parent be85d5e commit bf15126

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/cacheAdapterEnhancer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ export default function cacheAdapterEnhancer(adapter: AxiosAdapter, options: Opt
6969
}
7070

7171
/* istanbul ignore next */
72-
if (process.env.NODE_ENV === 'development' || process.env.LOGGER_LEVEL === 'info') {
72+
if (process.env.LOGGER_LEVEL === 'info') {
7373
// eslint-disable-next-line no-console
74-
console.info(`request cached by cache adapter: ${index}`);
74+
console.info(`[axios-extensions] request cached by cache adapter --> url: ${index}`);
7575
}
7676

7777
return responsePromise;

src/retryAdapterEnhancer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export default function retryAdapterEnhancer(adapter: AxiosAdapter, options: Opt
3131
count++;
3232

3333
/* istanbul ignore next */
34-
if (process.env.NODE_ENV === 'development' || process.env.LOGGER_LEVEL === 'info') {
35-
console.info(`request ${config.url} start retrying at time ${count}`);
34+
if (process.env.LOGGER_LEVEL === 'info') {
35+
console.info(`[axios-extensions] request start retrying --> url: ${config.url} , time: ${count}`);
3636
}
3737

3838
return request();

src/throttleAdapterEnhancer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ export default function throttleAdapterEnhancer(adapter: AxiosAdapter, options:
6868
if (responsePromise) {
6969

7070
/* istanbul ignore next */
71-
if (process.env.NODE_ENV === 'development' || process.env.LOGGER_LEVEL === 'info') {
71+
if (process.env.LOGGER_LEVEL === 'info') {
7272
// eslint-disable-next-line no-console
73-
console.info(`request cached by throttle adapter: ${index}`);
73+
console.info(`[axios-extensions] request cached by throttle adapter --> url: ${index}`);
7474
}
7575

7676
return responsePromise;

0 commit comments

Comments
 (0)