Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow wildcard match in util.debuglog() #17605

Closed
TylerYang opened this issue Dec 11, 2017 · 4 comments
Closed

allow wildcard match in util.debuglog() #17605

TylerYang opened this issue Dec 11, 2017 · 4 comments
Labels
feature request Issues that request new features to be added to Node.js. util Issues and PRs related to the built-in util module.

Comments

@TylerYang
Copy link
Contributor

TylerYang commented Dec 11, 2017

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

@vsemozhetbyt vsemozhetbyt added feature request Issues that request new features to be added to Node.js. util Issues and PRs related to the built-in util module. labels Dec 11, 2017
targos added a commit to targos/node that referenced this issue Dec 11, 2017
@targos
Copy link
Member

targos commented Dec 11, 2017

Thanks for opening this issue! This is something I always wanted to have :)
I opened #17607 to propose an implementation.

@TylerYang
Copy link
Contributor Author

TylerYang commented Dec 11, 2017

@targos Oh thx, I just finish my implementation also. Should I propose mine or make some changes on your codebase?

@targos
Copy link
Member

targos commented Dec 11, 2017

Oh sure, go ahead and open a PR with yours 😉

@TylerYang
Copy link
Contributor Author

@targos thx : )

MylesBorins pushed a commit that referenced this issue Jan 8, 2018
PR-URL: #17609
Fixes: #17605
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants