◐ Shell
clean mode source ↗

allow wildcard match in util.debuglog()

  • Version: all
  • Platform: all
  • Subsystem: util

Refs: #13728

Currently, util.debuglog() doesn't support wildcard. It will be more dev friendly if it could.
Consider the structure below,

├── classifiers
|   ├── logical-regression.js
|   └── linear-regression.js
|   └── decision-tree.js
|   └── ..lots of files...
├-index.js

we might have different files in the same module, and we really don't want to output those logs at the same time.

So a possible solution could be, we define a prefix/postfix to the same module, e.g. util.debuglog('classifiers-logical-regressions'), util.debuglog('classifiers-linear-regression')

Then we could define the NODE_DEBUG below to output *-regressions only logs, would be logical-regression and linear-regression in this case.

> SET NODE_DEBUG=classifiers-*-regression
> node index.js

Please feel free to add more comments.