-
Notifications
You must be signed in to change notification settings - Fork 942
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
5.x Roadmap #656
Comments
Any chance we can get the issue fixed where you have
DEBUG=* And you run As right now this won't work |
@OllieJennings #705 please search next time. |
@OllieJennings, that issue was closed prematurely, but it is not fixed. I switched back to debug@3 until the issue will get some attention and will be fixed. I suggest you to do the same thing. |
Please, there's no reason to post in two separate places about a closed ticket. Keep all discussion about that there - posting on the roadmap issue isn't going to get my attention any faster, I look at all issues regardless of urgency. |
Just to confirm, the 5.x roadmap stipulates that the module will use |
@getsnoopy It'll be configurable. If you want to use something other than |
If remove build system, How to also supports esm and cjs module? like this: "exports": {
".": {
"import": "./dist/my-lib.mjs",
"require": "./dist/my-lib.umd.js"
}
} |
I ended up doing a complete rewrite and adding Deno support by accident while trying to add ESM support. I think it would be a good jumping off point for a necessary refactor for node ESM/Unpkg's ?module mode/Vite/TS etc. Issues that code addresses to some degree:
I propose the following restructure:
Then for actual front facing code, we would use conditional exports to set the default entry point. You can do {
".": {
"node": "NodeDebug.class.mjs",
"deno": "DenoDebug.class.mjs",
"browser": "BrowserDebug.class.mjs", // I think this is deprecated in favor of module
"default": "Debug.class.mjs"
}
} Other things that would help:
Great api BTW! |
What is the status of v5? How long until a release that supports esm? |
Debug already supports ESM, and we're still kind of blocked on some Node things. |
When reading the readme I assumed it didn't supported it because of all the requires. |
There's not much to release at the moment. Plus it doesn't make sense to do much now until Node reaches feature parity with the Node ESM is inherently compatible with old |
I hope all is well. I've been keeping an eye on the discussions regarding the ReDoS vulnerability. I was wondering if there's any general sense or rough estimate on when we might expect the release of version 5.x with the necessary security updates. I understand that these things take time, and I appreciate the team's efforts to ensure a thorough fix. |
There's very little security risk in pre-5.x. Just don't feed user input into the main |
Will be great to have a conditional debug messages: const showMessageToUser = /* some complex condition */
debug.if(showMessageToUser)(/* ... */) Another great feature to have is a multiplexer, output of the same debug log-message to multiple namespaces: debug.to('namespace1', ... , 'namespaceN')('something strange: %o', object) this is useful when we have several namespaces that are attached to logs tracker systems (elk, datadog, etc) and we need that message be delivered to multiple "channels" |
One more feature: Escalate/DeEscalate for example we have some complex logic that may raise the exception... so idea is: when we caught the exception escalate the logs verbosity and when for example we do not have exceptions for some defined time, automatically de-escalate verbosity. try {
/* some logic */
debug.deescalate('2m', { /*options*/}) // normal execution, recover normal state of logs in 2 minutes
} catch (e) {
/* that should never happens */
// if it happens escalate verbosity for all namespaces for next 15mins
debug.escalate('15m', {cause: e, namespaces: '*', /* options */})
} and will be great to provide some kind of human readable time periods: 'now', '1m', '1h', '90m', '1h30m' p.s. and it will be great to have some buffer of prev messages that were not published/printed, but in the moment of escalation they can be reviewed and published. p.p.s. escalate/deescalate logic can be base on timer or "score" logic. "Score" logic means that we increase the priority score to some level, that corresponding specific levels of logs enabling (info, warning, debug, verbose, all). Escalate will increase the score, de-escalate will reduce the score. ref: https://medium.com/@olku/logging-its-hard-to-make-it-right-part-1-caa066c0e6b |
Both of those things are entirely out of scope for thie package, sorry. |
Can we have an debug lib extension API, so it will be possible to implement those features as additional library? |
debug is a CJS module with CJS dependencies. It will be an ESM module in it's [next major release](debug-js/debug#656), however that release issue has been open for over five years so it may never arrive. This PR vendors in the debug module as typescript so we can move on from CJS.
debug is a CJS module with CJS dependencies. It will be an ESM module in it's [next major release](debug-js/debug#656), however that release issue has been open for over five years so when that will ship is anyone's guess. weald is an API compatible port written in TypeScript and published as ESM. We can revert this change if/when `debug` finally ships an ESM version.
5.x Roadmap
It's about time for another step in bringing
debug
up to date - the5.x
major release.I know it hasn't been a long time since 4.x was released, and I'm aware that its release kind of
forced..pushed.. nudged users to update their best practices.Here's what to expect from the 5.x release:
debug
versions for formatting and pluggability upgrades ([RFC] Compatibility layer #644).enable()
(debug.enable()
flushes enabled namespaces #425, Wildcard in name doesn't auto enable on web #636, Regex injection inenable(namespaces)
#737)console.debug()
in the browser where available (Use console.debug() instead of console.log() where available (e.g. browsers) #600)The text was updated successfully, but these errors were encountered: