Skip to content

allow wildcard match in util.debuglog() #17605

Closed
@TylerYang

Description

@TylerYang
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions