Skip to content

Commit be263df

Browse files
authored
fix: Look for specific DEBUG value before outputting debug messages (#40)
1 parent 90317d3 commit be263df

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ const text = await retrier.retry(
161161
3. Run `npm install` to setup dependencies
162162
4. Run `npm test` to run tests
163163
164+
### Debug Output
165+
166+
Enable debugging output by setting the `DEBUG` environment variable to `"@hwc/retry"` before running.
167+
164168
## License
165169
166170
Apache 2.0

src/retrier.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const MAX_CONCURRENCY = 1000;
2222
* @returns {void}
2323
*/
2424
function debug(message) {
25-
if (globalThis?.process?.env.DEBUG) {
26-
console.log(message);
25+
if (globalThis?.process?.env.DEBUG === "@hwc/retry") {
26+
console.debug(message);
2727
}
2828
}
2929

0 commit comments

Comments
 (0)