-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
fix: restore 'debug' logs #151
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please add it to the history
Note: as-is, this does NOT restore the ability to use If it was really important to restore that behavior, we could do something hacky like: const debugCurrent = require('debug')('router')
const debugLegacy = require('debug')('express:router')
function debug(...args) {
debugCurrent(...args)
debugLegacy(...args)
} I tested this and it seems to work fine. That said, I'd prefer not to add something like this. I would rather open a follow-on PR in the v5 migration guide to explicitly state that router logs must now be viewed through the Let me know what y'all think. I'm open to other options as well. |
Revert "Remove debug dependency", with the following changes: - Update "var" to "const" for debug imports - Preserve history file so intermediate versions are documented correctly - Use latest version of debug This reverts commit 0b5a0a6.
f5e4c5c
to
3e10034
Compare
Done! I thought that might need to wait until the release, forgot about the "unreleased" pattern. Thanks for pointing it out. |
Re: my prior comment I realized that if it's important to restore In Express, we could subscribe to this channel, re-print any messages with @jonchurch this might have been what you suggested the other day, unless you were just proposing that diagnostic channels would be a better approach for the future. Either way, I'm curious what folks think about this. |
I think diagnostic channels would be for a different PR, and technically this is a separate package, so it doesn’t make sense for debug to be used for |
Agreed, the I only suggest this as an option, in the case that it is important to restore Update: My original motivation for suggesting this is that the related issue referred to expected logs missing from
This is a potential, though not ideal, solution. |
At this point, the best option is to update the migration guide about the fact that express:router in debug no longer exists, since it was a breaking change and no longer exists in [email protected]. The diagnostic channel would be great to try in the future. |
I agree. Unless there are any objections before I get to it, I'll go ahead and open that PR against the migration guide |
I opened the follow up PR to the migration guide: expressjs/expressjs.com#1819 This PR will need to be merged and released before that documentation is accurate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I don't think we should bring back express:*
to include router
, but it might mean we need to add some migration docs on this right? This is technically a breaking change we did already by removing it, so adding it here as the router
scope is pretty reasonable and forward moving imo.
Sounds good!
Yes - I opened a draft PR updating the migration docs. See my previous comment 🙂 |
Revert "Remove debug dependency", with the following changes:
This reverts commit 0b5a0a6.