Skip to content

Commit 73b4458

Browse files
committed
Use universal info logging since existing logging is expected to be seen without config
1 parent 69951fe commit 73b4458

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

src/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class CertificateError extends Error {
5555
await CertificateError.determineVerifyErrorCause(address);
5656
return new CertificateError(err.message, cause);
5757
} catch (error) {
58-
logger.debug(
58+
logger.info(
5959
`Failed to parse certificate from ${address}: ${error}`,
6060
);
6161
break;

src/inbox.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class Inbox implements vscode.Disposable {
6464
});
6565

6666
this.#socket.on("open", () => {
67-
logger.debug("Listening to Coder Inbox");
67+
logger.info("Listening to Coder Inbox");
6868
});
6969

7070
this.#socket.on("error", (error) => {
@@ -87,7 +87,7 @@ export class Inbox implements vscode.Disposable {
8787

8888
dispose() {
8989
if (!this.#disposed) {
90-
logger.debug("No longer listening to Coder Inbox");
90+
logger.info("No longer listening to Coder Inbox");
9191
this.#socket.close();
9292
this.#disposed = true;
9393
}
@@ -98,6 +98,6 @@ export class Inbox implements vscode.Disposable {
9898
error,
9999
"Got empty error while monitoring Coder Inbox",
100100
);
101-
logger.debug(message);
101+
logger.info(message);
102102
}
103103
}

src/remote.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class Remote {
118118
case "starting":
119119
case "stopping":
120120
writeEmitter = initWriteEmitterAndTerminal();
121-
logger.debug(`Waiting for ${workspaceName}...`);
121+
logger.info(`Waiting for ${workspaceName}...`);
122122
workspace = await waitForBuild(
123123
restClient,
124124
writeEmitter,
@@ -170,7 +170,7 @@ export class Remote {
170170
);
171171
}
172172
}
173-
logger.debug(
173+
logger.info(
174174
`${workspaceName} status is now ${workspace.latest_build.status}`,
175175
);
176176
}
@@ -239,7 +239,7 @@ export class Remote {
239239
}
240240

241241
logger.info(`Using deployment URL: ${baseUrlRaw}`);
242-
logger.debug(`Using deployment label: ${parts.label || "n/a"}`);
242+
logger.info(`Using deployment label: ${parts.label || "n/a"}`);
243243

244244
// We could use the plugin client, but it is possible for the user to log
245245
// out or log into a different deployment while still connected, which would
@@ -305,7 +305,7 @@ export class Remote {
305305
// Next is to find the workspace from the URI scheme provided.
306306
let workspace: Workspace;
307307
try {
308-
logger.debug(`Looking for workspace ${workspaceName}...`);
308+
logger.info(`Looking for workspace ${workspaceName}...`);
309309
workspace = await workspaceRestClient.getWorkspaceByOwnerAndName(
310310
parts.username,
311311
parts.workspace,
@@ -393,7 +393,7 @@ export class Remote {
393393
this.commands.workspace = workspace;
394394

395395
// Pick an agent.
396-
logger.debug(`Finding agent for ${workspaceName}...`);
396+
logger.info(`Finding agent for ${workspaceName}...`);
397397
const gotAgent = await this.commands.maybeAskAgent(workspace, parts.agent);
398398
if (!gotAgent) {
399399
// User declined to pick an agent.
@@ -404,7 +404,7 @@ export class Remote {
404404
logger.info(`Found agent ${agent.name} with status ${agent.status}`);
405405

406406
// Do some janky setting manipulation.
407-
logger.debug("Modifying settings...");
407+
logger.info("Modifying settings...");
408408
const remotePlatforms = this.vscodeProposed.workspace
409409
.getConfiguration()
410410
.get<Record<string, string>>("remote.SSH.remotePlatform", {});
@@ -504,7 +504,7 @@ export class Remote {
504504

505505
// Wait for the agent to connect.
506506
if (agent.status === "connecting") {
507-
logger.debug(`Waiting for ${workspaceName}/${agent.name}...`);
507+
logger.info(`Waiting for ${workspaceName}/${agent.name}...`);
508508
await vscode.window.withProgress(
509509
{
510510
title: "Waiting for the agent to connect...",
@@ -563,7 +563,7 @@ export class Remote {
563563
// If we didn't write to the SSH config file, connecting would fail with
564564
// "Host not found".
565565
try {
566-
logger.debug("Updating SSH config...");
566+
logger.info("Updating SSH config...");
567567
await this.updateSSHConfig(
568568
workspaceRestClient,
569569
parts.label,

src/workspaceMonitor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class WorkspaceMonitor implements vscode.Disposable {
4343
this.name = `${workspace.owner_name}/${workspace.name}`;
4444
const url = this.restClient.getAxiosInstance().defaults.baseURL;
4545
const watchUrl = new URL(`${url}/api/v2/workspaces/${workspace.id}/watch`);
46-
logger.debug(`Monitoring ${this.name}...`);
46+
logger.info(`Monitoring ${this.name}...`);
4747

4848
const eventSource = new EventSource(watchUrl.toString(), {
4949
fetch: createStreamingFetchAdapter(this.restClient.getAxiosInstance()),
@@ -86,7 +86,7 @@ export class WorkspaceMonitor implements vscode.Disposable {
8686
*/
8787
dispose() {
8888
if (!this.disposed) {
89-
logger.debug(`Unmonitoring ${this.name}...`);
89+
logger.info(`Unmonitoring ${this.name}...`);
9090
this.statusBarItem.dispose();
9191
this.eventSource.close();
9292
this.disposed = true;
@@ -203,7 +203,7 @@ export class WorkspaceMonitor implements vscode.Disposable {
203203
error,
204204
"Got empty error while monitoring workspace",
205205
);
206-
logger.debug(message);
206+
logger.info(message);
207207
}
208208

209209
private updateContext(workspace: Workspace) {

src/workspacesProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class WorkspaceProvider
9797
*/
9898
private async fetch(): Promise<WorkspaceTreeItem[]> {
9999
if (vscode.env.logLevel <= vscode.LogLevel.Debug) {
100-
logger.debug(
100+
logger.info(
101101
`Fetching workspaces: ${this.getWorkspacesQuery || "no filter"}...`,
102102
);
103103
}

vitest.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ export default defineConfig({
1313
"./src/test/**",
1414
],
1515
environment: "node",
16+
env: {
17+
NODE_ENV: "test",
18+
},
1619
},
1720
});

0 commit comments

Comments
 (0)