Skip to content

Commit d471ddf

Browse files
committed
Revert "feature(amazonq): start rotating logging to disk with cleanup"
This reverts commit 7ba15ce.
1 parent a9b7f47 commit d471ddf

File tree

3 files changed

+8
-412
lines changed

3 files changed

+8
-412
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as nls from 'vscode-nls'
88
import { LanguageClient, LanguageClientOptions, RequestType, State } from 'vscode-languageclient'
99
import { InlineCompletionManager } from '../app/inline/completion'
1010
import { AmazonQLspAuth, encryptionKey, notificationTypes } from './auth'
11-
import { RotatingLogChannel } from './rotatingLogChannel'
1211
import {
1312
CreateFilesParams,
1413
DeleteFilesParams,
@@ -95,23 +94,6 @@ export async function startLanguageServer(
9594

9695
const clientId = 'amazonq'
9796
const traceServerEnabled = Settings.instance.isSet(`${clientId}.trace.server`)
98-
99-
// Create custom output channel that writes to disk but sends UI output to the appropriate channel
100-
const lspLogChannel = new RotatingLogChannel(
101-
traceServerEnabled ? 'Amazon Q Language Server' : 'Amazon Q Logs',
102-
extensionContext,
103-
traceServerEnabled
104-
? vscode.window.createOutputChannel('Amazon Q Language Server', { log: true })
105-
: globals.logOutputChannel
106-
)
107-
108-
// Add cleanup for our file output channel
109-
toDispose.push({
110-
dispose: () => {
111-
lspLogChannel.dispose()
112-
},
113-
})
114-
11597
let executable: string[] = []
11698
// apply the GLIBC 2.28 path to node js runtime binary
11799
if (isSageMaker()) {
@@ -210,9 +192,15 @@ export async function startLanguageServer(
210192
},
211193
},
212194
/**
213-
* Using our RotatingLogger for all logs
195+
* When the trace server is enabled it outputs a ton of log messages so:
196+
* When trace server is enabled, logs go to a seperate "Amazon Q Language Server" output.
197+
* Otherwise, logs go to the regular "Amazon Q Logs" channel.
214198
*/
215-
outputChannel: lspLogChannel,
199+
...(traceServerEnabled
200+
? {}
201+
: {
202+
outputChannel: globals.logOutputChannel,
203+
}),
216204
}
217205

218206
const client = new LanguageClient(

packages/amazonq/src/lsp/rotatingLogChannel.ts

Lines changed: 0 additions & 228 deletions
This file was deleted.

0 commit comments

Comments
 (0)