Hi,
When i use node -inspect or babel-node -inspect i only see console.log in chrome and not the debug() message.

Thanks.
I'm having the same issue. I am using Node inspector Manager to automatically start the inspector panel. I use nodemon to automatically restart node server whenever a file is changed. Even further than this I setup Webpack with HMR (Hot module reload) and I have total coverage of /public and /server folders. It took me 2 weeks to learn how to setup but now it's starting to pay off.
npm install -g nodemon
npm install -g ts-node // In case you use typescript
nodemon.json
{
"verbose": false,
"watch": ["server/**/*.ts"],
"ext": "ts js json",
"ignore": ["server/**/*.spec.ts"],
"exec": "set DEBUG=app:*,-not_this & ts-node --inspect --debug-brk server/main.ts"
}
Still I have the problem of outputting debug to chrome debugger. I remember being able some time ago to use node-inspector and iron-node for the same purpose and they were outputting the debug statements just fine.
I'm also facing this issue. We are starting to use Node 8 in our back-end projects which (when using Visual Studio Code) defaults to the new v8-inspector protocol. Unfortunately, this means all of our debug() calls are no longer showing when we debug our applications.
There is a bit more information in a VS Code GitHub issue here:
https://github.com/Microsoft/vscode/issues/19750
...and a change that Winston added to support v8-inspector:
https://github.com/jdforsythe/winston/commit/dbc5b6f36b0162380dc65f221a346065dc94ec01
I realize that we can explicitly overwrite the log function on the module at a global and local level, but given that the v8-inspector protocol seems to be the new default it might make sense to handle this within the debug npm itself?
Thanks!
FYI
inspector protocol workaround ugly....
const debug = require('debug');
debug.log = console.log.bind(console);
@mrhein Thanks - that's what we're doing currently. It's acceptable for now but as it's a requirement for all Node 8 projects where we use the debugger it is a bit of a pain, especially for developers picking up projects that aren't aware of this caveat with debug & Node 8.
I'll see if I can create a PR to support this in a backwards compatible way.
@mrhein Thanks for the tip! Colors are missing and metadata is visible, but hey... it's better than nothing :D
Let's continue this in https://github.com/visionmedia/debug/issues/483.
@TooTallNate - Noticed you closed this issue. I realize that my issue is not quite the same as the original, so perhaps I should create a new issue?
Just to confirm, are we now expected to use debug.log = console.log.bind(console); on every project that we debug via Node's --inspect?
@thekiwi see #483 - I believe this was a duplicate that got moved to that issue.
If you feel your issue is indeed different, feel free to open another issue.
Facing the same issue here. debug() does not print messages _at all_ to the inspector console (note, as pointed out by @thekiwi, this is not the same as #483 which is a formatting issue).
I have the impression nobody ever uses the inspector console?
@ricardobeat https://github.com/visionmedia/debug/blob/master/src/browser.js#L179 does changing that line to the following fix your issue?
exports.log = (console.debug || console.log || (() => {})).bind(console);
@Qix- I'm running latest (4.1.1) and that function looks completely different: https://github.com/visionmedia/debug/blob/backport/4.1.1/src/browser.js#L178-L184
First, it seems that 4.1.1 on master has never been published. The code in the npm 4.1.1 package comes from the backport/4.1.1 branch.
Second, unfortunately the change doesn't make any difference. I believe the issue stems from using process.stderr.write in the default log method inside src/node.js, it's obvious that the inspector will not receive anything.
The simple fix mentioned at https://github.com/visionmedia/debug/issues/424#issuecomment-308541194 works for me, and _then_ we're back to #483 :)
Most helpful comment
FYI
inspector protocol workaround ugly....
const debug = require('debug');
debug.log = console.log.bind(console);