You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under the rationale that "it was never supported nor documented" (let's talk about this later), version 4.4.0 explicitly breaks the ability to pass regular expressions to debug.enable() function, which is a complete headache for me since I heavily rely on that feature for dynamic logging.
And not just for dynamic logging but also for making debug works in browser Worklets. Worklets cannot read localStorage from the browser so the only way to enable debug logging on them is by explicitly calling debug.enable(namespaces). And of course those namespaces are passed to those Worklets via internal message from the main browser JS application which of course reads them from localStorage.getItem('debug') which of course contains regular expressions because that's how debug library has always supposed to work, but since 4.4.0 this is no longer possible because those regexes only work when debug library reads the namespaces from localStorage.
With all respect, the rationale saying "it was never supported nor documented" is not very pleasant. The docs literally say (and have always said):
Set dynamically
You can also enable debug dynamically by calling the enable() method
Notice the "you can also". Where exactly should I assume that I can enable debug dynamically but without regexes? To be clear: The docs say today and the docs have always said that debug.enable() accepts wildcards:
So this is a total breaking change that makes debug library lose one of its nicest features while the docs still say that such a feature is present and the rationale for removing that feature is that "it was never documented". Well, it was.
Can I please ask this great library authors to restore this super useful feature?
The text was updated successfully, but these errors were encountered:
ibc
changed the title
4.4.0 breaks regexes in debug.enable() on purpose
4.4.0 breaks regexes in debug.enable() on purpose (but it was documented since ever)
Dec 23, 2024
Under the rationale that "it was never supported nor documented" (let's talk about this later), version 4.4.0 explicitly breaks the ability to pass regular expressions to
debug.enable()
function, which is a complete headache for me since I heavily rely on that feature for dynamic logging.And not just for dynamic logging but also for making
debug
works in browser Worklets. Worklets cannot readlocalStorage
from the browser so the only way to enabledebug
logging on them is by explicitly callingdebug.enable(namespaces)
. And of course thosenamespaces
are passed to those Worklets via internal message from the main browser JS application which of course reads them fromlocalStorage.getItem('debug')
which of course contains regular expressions because that's howdebug
library has always supposed to work, but since 4.4.0 this is no longer possible because those regexes only work whendebug
library reads the namespaces fromlocalStorage
.With all respect, the rationale saying "it was never supported nor documented" is not very pleasant. The docs literally say (and have always said):
Notice the "you can also". Where exactly should I assume that I can enable debug dynamically but without regexes? To be clear: The docs say today and the docs have always said that
debug.enable()
accepts wildcards:So this is a total breaking change that makes
debug
library lose one of its nicest features while the docs still say that such a feature is present and the rationale for removing that feature is that "it was never documented". Well, it was.Can I please ask this great library authors to restore this super useful feature?
The text was updated successfully, but these errors were encountered: