Skip to content

Commit

Permalink
Logs: Collect => Export
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Apr 26, 2022
1 parent c67bbdb commit bbeefb4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions extensions/gitpod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"contributes": {
"commands": [
{
"command": "gitpod.collectLogs",
"command": "gitpod.exportLogs",
"category": "Gitpod",
"title": "Collect all logs"
"title": "Export all logs"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function traverseFolder(folderUri: vscode.Uri, files: IFile[], token: vsco
}
}

export async function collectLogs(context: vscode.ExtensionContext) {
export async function exportLogs(context: vscode.ExtensionContext) {
const saveUri = await vscode.window.showSaveDialog({
title: 'Choose save location ...',
defaultUri: vscode.Uri.file(path.posix.join(os.homedir(), `vscode-desktop-logs-${new Date().toISOString().replace(/-|:|\.\d+Z$/g, '')}.zip`)),
Expand Down
8 changes: 4 additions & 4 deletions extensions/gitpod/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as tmp from 'tmp';
import * as path from 'path';
import * as vscode from 'vscode';
import { grpc } from '@improbable-eng/grpc-web';
import { collectLogs } from './collectLogs';
import { exportLogs } from './exportLogs';

interface SSHConnectionParams {
workspaceId: string;
Expand Down Expand Up @@ -435,11 +435,11 @@ export async function activate(context: vscode.ExtensionContext) {
}
}));

context.subscriptions.push(vscode.commands.registerCommand('gitpod.collectLogs', async () => {
context.subscriptions.push(vscode.commands.registerCommand('gitpod.exportLogs', async () => {
try {
await collectLogs(context);
await exportLogs(context);
} catch (e) {
const outputMessage = `Error collecting logs: ${e}`;
const outputMessage = `Error exporting logs: ${e}`;
vscode.window.showErrorMessage(outputMessage);
log(outputMessage);
// logger.error(outputMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/envir
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
import { IFileService } from 'vs/platform/files/common/files';
import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions';
import { CATEGORIES } from 'vs/workbench/common/actions';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { URI } from 'vs/base/common/uri';
import * as resources from 'vs/base/common/resources';
Expand Down Expand Up @@ -40,7 +39,7 @@ registerAction2(class ExportLogsAction extends Action2 {
super({
id: 'gitpod.workbench.exportLogs',
title: { original: 'Export all logs', value: 'Export all logs' },
category: CATEGORIES.Developer,
category: { original: 'Gitpod', value: 'Gitpod' },
menu: {
id: MenuId.CommandPalette
}
Expand Down

0 comments on commit bbeefb4

Please sign in to comment.