Skip to content

Commit b6d92aa

Browse files
committed
Add comment about default console.log handling
1 parent 04f5054 commit b6d92aa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/lsp/src/logging.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ export class Logger extends Disposable implements ILogger {
149149
break;
150150
}
151151
} else {
152+
// Note that by default, languageserver redirects `console.log` to the
153+
// client. However this is only the case with StdIo connections:
154+
// https://github.com/microsoft/vscode-languageserver-node/blob/df56e720/server/src/node/main.ts#L262-L264
155+
// While we currently only use StdIo to connect the LSP, and so the branch
156+
// above to explicitly log via our connection object is not strictly
157+
// necessary, it's still better to use our own logger abstraction that we
158+
// are in control of.
152159
this._logFn(value);
153160
}
154161
}

0 commit comments

Comments
 (0)