Skip to content

Commit 4c915ba

Browse files
committed
Remove console.log from server
1 parent b3ca0e6 commit 4c915ba

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

server/src/server.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -345,31 +345,29 @@ let sendCompilationFinishedMessage = () => {
345345
send(notification);
346346
};
347347

348-
let debug = false;
349-
350348
let syncProjectConfigCache = async (rootPath: utils.NormalizedPath) => {
351349
try {
352-
if (debug) console.log("syncing project config cache for " + rootPath);
350+
getLogger().log("syncing project config cache for " + rootPath);
353351
await utils.runAnalysisAfterSanityCheck(rootPath, [
354352
"cache-project",
355353
rootPath,
356354
]);
357-
if (debug) console.log("OK - synced project config cache for " + rootPath);
355+
getLogger().log("OK - synced project config cache for " + rootPath);
358356
} catch (e) {
359-
if (debug) console.error(e);
357+
getLogger().error(JSON.stringify(e));
360358
}
361359
};
362360

363361
let deleteProjectConfigCache = async (rootPath: utils.NormalizedPath) => {
364362
try {
365-
if (debug) console.log("deleting project config cache for " + rootPath);
363+
getLogger().log("deleting project config cache for " + rootPath);
366364
await utils.runAnalysisAfterSanityCheck(rootPath, [
367365
"cache-delete",
368366
rootPath,
369367
]);
370-
if (debug) console.log("OK - deleted project config cache for " + rootPath);
368+
getLogger().log("OK - deleted project config cache for " + rootPath);
371369
} catch (e) {
372-
if (debug) console.error(e);
370+
getLogger().error(JSON.stringify(e));
373371
}
374372
};
375373

@@ -400,7 +398,7 @@ async function onWorkspaceDidChangeWatchedFiles(
400398
sendCodeLensRefresh();
401399
}
402400
} catch {
403-
console.log("Error while sending updated diagnostics");
401+
getLogger().error("Error while sending updated diagnostics");
404402
}
405403
} else {
406404
ic.incrementalCompilationFileChanged(

0 commit comments

Comments
 (0)