Skip to content

Commit

Permalink
Do not send 'null' in to telemetry
Browse files Browse the repository at this point in the history
Signed-off-by: Yevhen Vydolob <[email protected]>
  • Loading branch information
evidolob committed Jul 19, 2021
1 parent e44fc1b commit ebed8ac
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@ if (process.argv.indexOf('--stdio') === -1) {
console.log = connection.console.log.bind(connection.console);
console.error = connection.console.error.bind(connection.console);

// temporary, if some code call console.log(null), we log trace to find the place where it was called
//vscode-nls calls console.error(null) in some cases, so we put that in info, to predict sending "null" in to telemetry
console.error = (arg) => {
connection.console.error(arg);
if (arg === null) {
try {
throw new Error();
} catch (err) {
connection.console.error(err.stack);
}
connection.console.info(arg);
} else {
connection.console.error(arg);
}
};

Expand Down

0 comments on commit ebed8ac

Please sign in to comment.