Skip to content

Fix ESLint debug output log level - #2212

Open
Pradeep Ramola (pradeep-ramola) wants to merge 1 commit into
microsoft:mainfrom
pradeep-ramola:fix/GH-2060-debug-log-level
Open

Fix ESLint debug output log level#2212
Pradeep Ramola (pradeep-ramola) wants to merge 1 commit into
microsoft:mainfrom
pradeep-ramola:fix/GH-2060-debug-log-level

Conversation

@pradeep-ramola

Copy link
Copy Markdown
Contributor

Fixes #2060

Summary

When eslint.debug is enabled, ESLint debug output is emitted through stderr by the debug package, so VS Code shows those informational debug lines with an error label.

This change routes only ESLint debug output (eslint: / eslintrc: namespaces) through connection.console.info, while leaving real stderr/server errors untouched.

It also sets DEBUG_HIDE_DATE=true and DEBUG_COLORS=false so the output channel does not show duplicate timestamps or ANSI color codes.

Validation

Passed locally:

npm run lint --prefix server
npm run lint --prefix client
npx tsc --ignoreConfig --noEmit --target ES2022 --module Node16 --moduleResolution Node16 --types node --skipLibCheck server/src/debugLog.ts

@dbaeumer

Copy link
Copy Markdown
Member

Although this is working the server side is not the right place to fix this. Major reason is that the server doesn't know anything about the formatting of the output channel and different clients might handle things differently. A better solution is to do this on the client side by overriding the error, warn, log and info method and string any date format from the start of the message.

@dbaeumer Dirk Bäumer (dbaeumer) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See latest comment in PR.

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

Successfully merging this pull request may close these issues.

VS Code ESLint@3.0.16 --debug option

2 participants