-
Notifications
You must be signed in to change notification settings - Fork 944
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When debugging the applications that work with pools of streams or sockets, the debug stream often comes out interleaved making it impossible to distinguish between streams. It is a common knowledge that unique `id`s could be assigned to each stream and be used in logging to solve this. However, this solution is rather ad-hoc and usually applied only during manual debugging. This commit introduces standard function `debug.id()` that increments the internal counter only when debugging is enabled, and otherwise returns `undefined`.
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters