Skip to content

Commit 46e973f

Browse files
authored
fix(logs): noisy git output in logs aws#6192
## Problem Git commands are too noisy; running /review always opens Amazon Q output channel with git command output ## Solution - Output to the Amazon Q Logs channel instead - Make it verbose level so it won't show by default
1 parent 70a9295 commit 46e973f

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Code Review: Cleaned up output logs when running /review"
4+
}

packages/core/src/codewhisperer/util/gitUtil.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { showOutputMessage } from '../../shared/utilities/messages'
7-
import { getLogger, globals, removeAnsi } from '../../shared'
6+
import { getLogger, removeAnsi } from '../../shared'
87
import { ChildProcess, ChildProcessOptions } from '../../shared/utilities/processUtils'
98
import { Uri } from 'vscode'
109

@@ -17,10 +16,10 @@ export async function isGitRepo(folder: Uri): Promise<boolean> {
1716
rejectOnErrorCode: true,
1817
onStdout: (text) => {
1918
output += text
20-
showOutputMessage(removeAnsi(text), globals.outputChannel)
19+
getLogger().verbose(removeAnsi(text))
2120
},
2221
onStderr: (text) => {
23-
showOutputMessage(removeAnsi(text), globals.outputChannel)
22+
getLogger().error(removeAnsi(text))
2423
},
2524
spawnOptions: {
2625
cwd: folder.fsPath,

packages/core/src/codewhisperer/util/zipUtil.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import {
2222
} from '../models/errors'
2323
import { ZipUseCase } from '../models/constants'
2424
import { ChildProcess, ChildProcessOptions } from '../../shared/utilities/processUtils'
25-
import { showOutputMessage } from '../../shared/utilities/messages'
26-
import { globals, removeAnsi } from '../../shared'
25+
import { removeAnsi } from '../../shared'
2726

2827
export interface ZipMetadata {
2928
rootDir: string
@@ -303,10 +302,10 @@ export class ZipUtil {
303302
rejectOnErrorCode: false,
304303
onStdout: (text) => {
305304
diffContent += text
306-
showOutputMessage(removeAnsi(text), globals.outputChannel)
305+
getLogger().verbose(removeAnsi(text))
307306
},
308307
onStderr: (text) => {
309-
showOutputMessage(removeAnsi(text), globals.outputChannel)
308+
getLogger().error(removeAnsi(text))
310309
},
311310
spawnOptions: {
312311
cwd: projectPath,
@@ -340,10 +339,10 @@ export class ZipUtil {
340339
rejectOnErrorCode: true,
341340
onStdout: (text) => {
342341
diffContent += text
343-
showOutputMessage(removeAnsi(text), globals.outputChannel)
342+
getLogger().verbose(removeAnsi(text))
344343
},
345344
onStderr: (text) => {
346-
showOutputMessage(removeAnsi(text), globals.outputChannel)
345+
getLogger().error(removeAnsi(text))
347346
},
348347
spawnOptions: {
349348
cwd: projectPath,

0 commit comments

Comments
 (0)