Repository navigation
Open
Labels
discussionThis issue is requesting comments and discussionThis issue is requesting comments and discussionhelp-wantedThis issue has an actionable itemThis issue has an actionable item
Milestone
Description
5.x Roadmap
It's about time for another step in bringing debug up to date - the 5.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:
- Custom output format (Customizing output format #582, Custom output formatting #645)
- Pluggable logging handlers ([RFC] Pluggable log handler #556)
- Timed sections (Add timed sections #485)
- No more transpiling (smaller package size) (Remove build step / bundling / babelifying #652, Remove build system #655)
- Patching of old
debugversions for formatting and pluggability upgrades ([RFC] Compatibility layer #644) - Overhaul of
.enable()(debug.enable()flushes enabled namespaces #425, Wildcard in name doesn't auto enable on web #636, Regex injection inenable(namespaces)#737) - Use
console.debug()in the browser where available (Use console.debug() instead of console.log() where available (e.g. browsers) #600) - Simpler documentation (Clean up README #649)
- Passing a function to avoid execution if namespace is disabled (Allow function to be passed & executed if enabled #497)
- Simplified codebase (lots dead code/dotfile removal; [RFC] Remove examples/ folder in lieu of proper README documentation? #650)
- Specify namespace in URL (Specify namespace with url in ESM #948)
- Several bugfixes
Reacted by Dimitri KOPRIWA, korywka, Ollie Jennings, Jean Honlet, Borek Bernard, David Brownman, Edoardo Gallo, Sergii Lavrin, Kirill Groshkov, zprjk and 5 more
Reacted by Keenwon, Quinn Chaffee, Ümit Gedik, Edoardo Gallo, Kirill Groshkov, Shinra Yamakawa, Brian Harrington and Kevin Van Lierde
Metadata
Metadata
Assignees
Labels
discussionThis issue is requesting comments and discussionThis issue is requesting comments and discussionhelp-wantedThis issue has an actionable itemThis issue has an actionable item
Activity
OllieJennings commentedon May 15, 2019
Any chance we can get the issue fixed where you have
.envAnd you run
babel-node -r dotenv/config ./index.jsAs right now this won't work
Qix- commentedon May 15, 2019
@OllieJennings #705 please search next time.
botond-veress commentedon May 18, 2019
@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.
Qix- commentedon May 18, 2019
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.
getsnoopy commentedon Jul 26, 2020
Just to confirm, the 5.x roadmap stipulates that the module will use
console.debugfor Node.js environments as well, correct? The description in the OP here is different than that of the linked issue.Qix- commentedon Jul 26, 2020
@getsnoopy It'll be configurable. If you want to use something other than
console.debugyou would make your own log handler. That's defined in #556.suiyun39 commentedon Jun 22, 2022
If remove build system, How to also supports esm and cjs module?
When used in nodejs, in most cases no bundle tools, requires the library to provide two versions of the export.
like this:
1 remaining item
OleksandrKucherenko commentedon Sep 13, 2022
Will be great to provide default mock implementation for jest tests, in some cases debug logs is the only one option left for capturing the test success or failure. (Not the best practice, of course)
FossPrime commentedon Jun 5, 2023
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!
bryanjtc commentedon Nov 1, 2023
What is the status of v5? How long until a release that supports esm?
Qix- commentedon Nov 1, 2023
Debug already supports ESM, and we're still kind of blocked on some Node things.
bryanjtc commentedon Nov 1, 2023
When reading the readme I assumed it didn't supported it because of all the requires.
Have you thought of simplifying the release and push those blocking changes to v6?
Qix- commentedon Nov 1, 2023
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
requires()system.Node ESM is inherently compatible with old
require()packages by the way. Just because we haverequire()in the readme doesn't stop you fromimporting it.adominguezepiuse commentedon Dec 18, 2023
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.
Qix- commentedon Dec 18, 2023
There's very little security risk in pre-5.x. Just don't feed user input into the main
debugconstructor.OleksandrKucherenko commentedon Dec 19, 2023
Will be great to have a conditional debug messages:
Another great feature to have is a multiplexer, output of the same debug log-message to multiple namespaces:
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"
OleksandrKucherenko commentedon Dec 19, 2023
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.
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
Qix- commentedon Dec 19, 2023
Both of those things are entirely out of scope for thie package, sorry.
OleksandrKucherenko commentedon Dec 22, 2023
Can we have an debug lib extension API, so it will be possible to implement those features as additional library?
fix: vendor in debug module
fix: replace debug with weald to remove CJS deps (#2648)