expressjs / expressjs.com

Home Page:https://expressjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debugging guide references DEBUG_FD environment variable which was removed from node debug module

HughG opened this issue · comments

The debugging page of the Guide mentions several environment variables which can be used to control the debug module. However, DEBUG_FD was removed mid-2017 (debug-js/debug@ff432e7). It might be better just to refer to the debug documentation, and mentioned that there are some environment variables, without listing them. That would avoid this problem and avoid getting out of sync with any future changes.

Express stil has DEBUG_FD, though, which is why we document it. Is it not working for you?

Hi Doug. That wasn't obvious to me from the documentation -- I assumed the express docs were just excerpting the debug docs (linked shortly later) for convenience. I don't know much about express and was diving in to diagnose a problem. Maybe it would have worked, but I just followed the link shortly to the "debug" docs, saw no mention of DEBUG_FD there, and got confused.

Maybe the fix here is to document that some/all of these environment variables are interpreted directly by express, regardless of how "debug" interprets them, or something like that?

(I ended up solving my problem a different way because it turned out that, in my context, both stderr and stdout were captured together with explicit app-level logging, but to a "secret" extra log file, by a different part of our overall setup.)

There is only a small mention of the debug module on the debugging page, so I guess we can just remove that so our docs stand alone so there is no confusion -- it documents how to debug in Express, regardless of what exactly internal dependencies are used.