|
5 | 5 |
|
6 | 6 | import * as vscode from 'vscode'
|
7 | 7 | import { CloudWatchLogs } from 'aws-sdk'
|
8 |
| -import { CloudWatchLogsSettings, parseCloudWatchLogsUri, uriToKey, createURIFromArgs } from '../cloudWatchLogsUtils' |
| 8 | +import { CloudWatchLogsSettings, parseCloudWatchLogsUri, uriToKey, msgKey } from '../cloudWatchLogsUtils' |
9 | 9 | import { DefaultCloudWatchLogsClient } from '../../shared/clients/cloudWatchLogsClient'
|
10 | 10 | import { waitTimeout } from '../../shared/utilities/timeoutUtils'
|
11 | 11 | import { Messages } from '../../shared/utilities/messages'
|
@@ -78,9 +78,13 @@ export class LogDataRegistry {
|
78 | 78 | // We are at the earliest data and trying to go back in time, there is nothing to see.
|
79 | 79 | // If we don't return now, redundant data will be retrieved.
|
80 | 80 | if (isHead && logData.previous?.token === undefined) {
|
81 |
| - const msgId = uriToKey(uri) |
82 | 81 | // show something so the user doesn't think nothing happened.
|
83 |
| - await Messages.putMessage(msgId, `Loading from: '${logData.logGroupInfo.groupName}'`, undefined, 500) |
| 82 | + await Messages.putMessage( |
| 83 | + msgKey(logData.logGroupInfo), |
| 84 | + `Loading from: '${logData.logGroupInfo.groupName}'`, |
| 85 | + undefined, |
| 86 | + 500 |
| 87 | + ) |
84 | 88 | return []
|
85 | 89 | }
|
86 | 90 |
|
@@ -108,8 +112,10 @@ export class LogDataRegistry {
|
108 | 112 | return last
|
109 | 113 | }
|
110 | 114 |
|
111 |
| - const msgId = uriToKey(uri) |
112 |
| - const msgTimeout = await Messages.putMessage(msgId, `Loading from: '${logData.logGroupInfo.groupName}'`) |
| 115 | + const msgTimeout = await Messages.putMessage( |
| 116 | + msgKey(logData.logGroupInfo), |
| 117 | + `Loading from: '${logData.logGroupInfo.groupName}'` |
| 118 | + ) |
113 | 119 | const responseData = await firstOrLast(stream, resp => resp.events.length > 0).finally(() => {
|
114 | 120 | msgTimeout.dispose()
|
115 | 121 | })
|
@@ -232,8 +238,7 @@ export async function filterLogEventsFromUri(
|
232 | 238 | delete cwlParameters.logStreamNames
|
233 | 239 | }
|
234 | 240 |
|
235 |
| - const msgId = uriToKey(createURIFromArgs(logGroupInfo, parameters)) |
236 |
| - const msgTimeout = await Messages.putMessage(msgId, `Loading from: '${logGroupInfo.groupName}'`, { |
| 241 | + const msgTimeout = await Messages.putMessage(msgKey(logGroupInfo), `Loading from: '${logGroupInfo.groupName}'`, { |
237 | 242 | message: logGroupInfo.streamName ?? '',
|
238 | 243 | })
|
239 | 244 |
|
|
0 commit comments