diff --git a/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts b/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts index 21b3b9ea8d7..de235cabc23 100644 --- a/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts +++ b/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts @@ -43,7 +43,8 @@ export async function tailLogGroup( } const session = new LiveTailSession(liveTailSessionConfig) if (registry.has(uriToKey(session.uri))) { - await prepareDocument(session) + await vscode.window.showTextDocument(session.uri, { preview: false }) + void vscode.window.showInformationMessage(`Switching editor to an existing session that matches request.`) span.record({ result: 'Succeeded', sessionAlreadyStarted: true, diff --git a/packages/core/src/awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu.ts b/packages/core/src/awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu.ts index a76ec8861e4..c94259684bb 100644 --- a/packages/core/src/awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu.ts +++ b/packages/core/src/awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu.ts @@ -41,7 +41,7 @@ export class LogStreamFilterSubmenu extends Prompter { public createMenuPrompter() { const helpUri = startLiveTailHelpUrl const prompter = createQuickPick(this.menuOptions, { - title: 'Select LogStream filter type', + title: 'Include log events from...', buttons: createCommonButtons(helpUri), }) return prompter @@ -50,18 +50,15 @@ export class LogStreamFilterSubmenu extends Prompter { private get menuOptions(): DataQuickPickItem[] { const options: DataQuickPickItem[] = [] options.push({ - label: 'All', - detail: 'Include log events from all LogStreams in the selected LogGroup', + label: 'All Log Streams', data: 'all', }) options.push({ - label: 'Specific', - detail: 'Include log events from only a specific LogStream', + label: 'Specific Log Stream', data: 'specific', }) options.push({ - label: 'Prefix', - detail: 'Include log events from LogStreams that begin with a provided prefix', + label: 'Log Streams matching prefix', data: 'prefix', }) return options @@ -70,9 +67,9 @@ export class LogStreamFilterSubmenu extends Prompter { public createLogStreamPrefixBox(): InputBoxPrompter { const helpUri = startLiveTailLogStreamPrefixHelpUrl return createInputBox({ - title: 'Enter LogStream prefix', - placeholder: 'logStream prefix (case sensitive; empty matches all)', - prompt: 'Only log events in the LogStreams that have names that start with the prefix that you specify here are included in the Live Tail session', + title: 'Enter Log Stream prefix', + placeholder: 'log stream prefix (case sensitive; empty matches all)', + prompt: 'Only log events in Log Streams whose name starts with the supplied prefix will be included.', validateInput: (input) => this.validateLogStreamPrefix(input), buttons: createCommonButtons(helpUri), }) @@ -80,11 +77,11 @@ export class LogStreamFilterSubmenu extends Prompter { public validateLogStreamPrefix(prefix: string) { if (prefix.length > 512) { - return 'LogStream prefix cannot be longer than 512 characters' + return 'Log Stream prefix cannot be longer than 512 characters' } if (!this.logStreamPrefixRegEx.test(prefix)) { - return 'LogStream prefix must match pattern: [^:*]*' + return 'Log Stream prefix must match pattern: [^:*]*' } } @@ -104,7 +101,7 @@ export class LogStreamFilterSubmenu extends Prompter { .map((streams) => streams!.map((stream) => ({ data: stream.logStreamName!, label: stream.logStreamName! }))) return createQuickPick(items, { - title: 'Select LogStream', + title: 'Select Log Stream', buttons: createCommonButtons(helpUri), }) } diff --git a/packages/core/src/awsService/cloudWatchLogs/wizard/tailLogGroupWizard.ts b/packages/core/src/awsService/cloudWatchLogs/wizard/tailLogGroupWizard.ts index cc07bc71961..025820df792 100644 --- a/packages/core/src/awsService/cloudWatchLogs/wizard/tailLogGroupWizard.ts +++ b/packages/core/src/awsService/cloudWatchLogs/wizard/tailLogGroupWizard.ts @@ -38,7 +38,7 @@ export class TailLogGroupWizard extends Wizard { this.form.regionLogGroupSubmenuResponse.bindPrompter(createRegionLogGroupSubmenu) this.form.logStreamFilter.bindPrompter((state) => { if (!state.regionLogGroupSubmenuResponse?.data) { - throw new ToolkitError('LogGroupName is null') + throw new ToolkitError('Log Group name is null') } return new LogStreamFilterSubmenu( state.regionLogGroupSubmenuResponse.data, @@ -57,7 +57,7 @@ export function createRegionLogGroupSubmenu(): RegionSubmenu { buttons: [createExitButton()], }, { title: localize('AWS.cwl.tailLogGroup.regionPromptTitle', 'Select Region for Log Group') }, - 'LogGroups' + 'Log Groups' ) } @@ -69,7 +69,7 @@ async function getLogGroupQuickPickOptions(regionCode: string): Promise { input.acceptValue(invalidInput) - assert.deepEqual(input.validationMessage, 'LogStream prefix must match pattern: [^:*]*') + assert.deepEqual(input.validationMessage, 'Log Stream prefix must match pattern: [^:*]*') input.hide() }) const inputBox = logStreamFilterSubmenu.createLogStreamPrefixBox() @@ -53,7 +57,7 @@ describe('liveTailLogStreamSubmenu', async function () { const invalidInput = 'my-log-stream*' getTestWindow().onDidShowInputBox((input) => { input.acceptValue(invalidInput) - assert.deepEqual(input.validationMessage, 'LogStream prefix must match pattern: [^:*]*') + assert.deepEqual(input.validationMessage, 'Log Stream prefix must match pattern: [^:*]*') input.hide() }) const inputBox = logStreamFilterSubmenu.createLogStreamPrefixBox() @@ -64,7 +68,7 @@ describe('liveTailLogStreamSubmenu', async function () { const invalidInput = 'a'.repeat(520) getTestWindow().onDidShowInputBox((input) => { input.acceptValue(invalidInput) - assert.deepEqual(input.validationMessage, 'LogStream prefix cannot be longer than 512 characters') + assert.deepEqual(input.validationMessage, 'Log Stream prefix cannot be longer than 512 characters') input.hide() }) const inputBox = logStreamFilterSubmenu.createLogStreamPrefixBox()