Skip to content

Can't Disable debug #495

New issue

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

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

Already on GitHub? # to your account

Closed
ilyaigpetrov opened this issue Aug 30, 2017 · 4 comments
Closed

Can't Disable debug #495

ilyaigpetrov opened this issue Aug 30, 2017 · 4 comments
Labels
bug This issue identifies a malfunction

Comments

@ilyaigpetrov
Copy link

https://runkit.com/ilyaigpetrov/59a6ef385d75ca0011ffb2c3

const debug = require('debug')
console.log('ENABLED_1?', debug.enabled('*'));
debug.enable('*');
debug.disable('*');
console.log('ENABLED_2?', debug.enabled('*'));

Output:

ENABLED_1?
true
ENABLED_2?
true
@thebigredgeek
Copy link
Contributor

@TooTallNate looks like we never fixed this :(

@bmacnaughton
Copy link
Contributor

bmacnaughton commented Oct 19, 2017

It would be ideal to only disable the namespaces specified in the debug.disable() call.

So a call with no arguments so that debug.disable() would disable all while a call with debug.disable('*') would remove the wildcard pattern if present, e.g.,

debug.enable('bruce:test,bruce:prod')

would result in debug.names equal to [ /^bruce:test$/, /^bruce:prod$/ ]

then debug.enable('*')

would result in debug.names equal to [ /^bruce:test$/, /^bruce:prod$/, /^.*?$/ ]

then debug.disable('*')

would result in debug.names equal to [ /^bruce:test$/, /^bruce:prod$/ ]

Just an idea. Thanks for the great facility either way.

@natew
Copy link

natew commented Nov 14, 2017

I can't seem to disable it either... but it's hard to believe this is a real bug if only one person upvoted. Is there really no way to disable logs in browser? I've tried a lot of combinations, specific and wildcard, and it seems to never persists or disable any logging.

@Qix- Qix- added the bug This issue identifies a malfunction label Jun 20, 2018
@Qix-
Copy link
Member

Qix- commented Dec 18, 2018

Confirmed still a bug in the latest version. See #425 as this will be fixed by that.

@Qix- Qix- closed this as completed Dec 18, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug This issue identifies a malfunction
Development

Successfully merging a pull request may close this issue.

5 participants