From 49844ab717d8d1790dbdf7f44d160936ece0e80f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Feb 2020 15:59:46 +0100 Subject: Extract client-side logging --- editors/code/src/installation/server.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'editors/code/src/installation/server.ts') diff --git a/editors/code/src/installation/server.ts b/editors/code/src/installation/server.ts index 750852921..685abfdc6 100644 --- a/editors/code/src/installation/server.ts +++ b/editors/code/src/installation/server.ts @@ -7,6 +7,7 @@ import { spawnSync } from "child_process"; import { BinarySource } from "./interfaces"; import { fetchArtifactReleaseInfo } from "./fetch_artifact_release_info"; import { downloadArtifact } from "./download_artifact"; +import { log } from "../util"; export async function ensureServerBinary(source: null | BinarySource): Promise { if (!source) { @@ -40,7 +41,7 @@ export async function ensureServerBinary(source: null | BinarySource): Promise console.log("DNS resolution for example.com was successful", addrs), + addrs => log.debug("DNS resolution for example.com was successful", addrs), err => { - console.error( + log.error( "DNS resolution for example.com failed, " + "there might be an issue with Internet availability" ); - console.error(err); + log.error(err); } ); return false; @@ -105,19 +106,19 @@ function isBinaryAvailable(binaryPath: string): boolean { // ACHTUNG! `res` type declaration is inherently wrong, see // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/42221 - console.log("Checked binary availablity via --version", res); - console.log(binaryPath, "--version output:", res.output?.map(String)); + log.debug("Checked binary availablity via --version", res); + log.debug(binaryPath, "--version output:", res.output?.map(String)); return res.status === 0; } function getServerVersion(storage: vscode.Memento): null | string { const version = storage.get("server-version", null); - console.log("Get server-version:", version); + log.debug("Get server-version:", version); return version; } async function setServerVersion(storage: vscode.Memento, version: string): Promise { - console.log("Set server-version:", version); + log.debug("Set server-version:", version); await storage.update("server-version", version.toString()); } -- cgit v1.2.3