Skip to content
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

Move debuglog out of diagnostic channels #3809

Open
mcollina opened this issue Nov 7, 2024 · 4 comments
Open

Move debuglog out of diagnostic channels #3809

mcollina opened this issue Nov 7, 2024 · 4 comments

Comments

@mcollina
Copy link
Member

mcollina commented Nov 7, 2024

Unfortunately, using diagnostic channels to set up debuglog was a bad idea. It won't work because our implementation inside Node.js will react to the same NODE_DEBUG flag, and duplicate the messages, making these logs hard to read.

A solution for this would be:

  1. detect if we are running in Node.js core, and if so, use a different debuglog prefix
  2. move away from using diagnostics channels and just inline the debuglogs

Do you see any other options?

@metcoder95
Copy link
Member

I'd prefer to see if we can inline it. The coupling of both concepts seems like a good idea but in reality, they overlap and serve different purposes.

@KhafraDev
Copy link
Member

detect if we are running in Node.js core, and if so, use a different debuglog prefix

this was my idea, haven't had time to work on it. It's easy to detect when we're in node core already

const defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'
? 'node'
: 'undici'

@Uzlopak
Copy link
Contributor

Uzlopak commented Nov 7, 2024

I am curious if not PR #3600 introduced this issue. Maybe the old subscribe referred to a separate diagnostic sub channel or so? I mean we had not this issue before?!

@mcollina
Copy link
Member Author

The issue was always there, but we avoided it by disabling global fetch in our tests. This is not possible anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants