Skip to content

Commit

Permalink
fix: Look for specific DEBUG value before outputting debug messages (#40
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nzakas authored Nov 5, 2024
1 parent 90317d3 commit be263df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ const text = await retrier.retry(
3. Run `npm install` to setup dependencies
4. Run `npm test` to run tests
### Debug Output
Enable debugging output by setting the `DEBUG` environment variable to `"@hwc/retry"` before running.
## License
Apache 2.0
Expand Down
4 changes: 2 additions & 2 deletions src/retrier.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const MAX_CONCURRENCY = 1000;
* @returns {void}
*/
function debug(message) {
if (globalThis?.process?.env.DEBUG) {
console.log(message);
if (globalThis?.process?.env.DEBUG === "@hwc/retry") {
console.debug(message);
}
}

Expand Down

0 comments on commit be263df

Please sign in to comment.