question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`.enabled()` logic incorrectly returns true when namespace contains asterisk

See original GitHub issue
debug.disable('*');
debug.enable('foo');
assert.not(debug.enabled('bar'));
assert.not(debug.enabled('bar*')); // throws; returns true

Has to be solved in two ways:

  • More stringent checks on namespaces (as they shouldn’t contain asterisks)
  • Remove the check for ns[ns.length-1]==='*', which makes absolutely no sense

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jasonkcommented, Feb 20, 2020

According to the documentation, this is by design:

If you append a “*” to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable.

0reactions
stephenhandleycommented, Jun 28, 2020

naively seems like if (name === '*') { return true; } would be less surprising.

would be interesting to know if anyone made use of the bar* thing in some way

Read more comments on GitHub >

github_iconTop Results From Across the Web

Some Practice Problems for the C++ Exam and Solutions for ...
If the function is passed an argument that is not positive (i.e., greater than zero), then the function should return the value 0...
Read more >
Send related messages in order by using a sequential convoy ...
The scope returns an error message that includes the session ID where the problem happened, and terminates the logic app. Here is the...
Read more >
XQuery 3.1: An XML Query Language - W3C
In [XML Path Language (XPath) Version 1.0], the in-scope namespaces of an element node are represented by a collection of namespace nodes ...
Read more >
GitHub - ruppysuppy/Daily-Coding-Problem-Solutions
Given the regular expression ". *at" and the string "chat", your function should return true.
Read more >
Python Tutorial - Getting Started with Python and Python Basics
As the input() function returns a string, we need to cast it to int . if __name__ == '__main__': (Line 87): When you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found