Skip to content

Commit 74c46a4

Browse files
committed
revert logs
1 parent 6071be7 commit 74c46a4

File tree

4 files changed

+8
-23
lines changed

4 files changed

+8
-23
lines changed

packages/amazonq/test/e2e/amazonq/review.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ describe('Amazon Q Code Review', function () {
210210

211211
assert.ok(securityDiagnostics.length > 0, 'No security diagnostics found')
212212

213-
// 1 exact critical issue matches
213+
// at least 1 exact critical issue matches
214214
assert.ok(
215215
matchingSecurityDiagnosticCount(securityDiagnostics, 'CWE-798 - Hardcoded credentials', 21) >= 1
216216
)

packages/core/src/codewhisperer/commands/basicCommands.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,18 +367,11 @@ export const updateReferenceLog = Commands.declare(
367367
export const openSecurityIssuePanel = Commands.declare(
368368
'aws.amazonq.openSecurityIssuePanel',
369369
(context: ExtContext) => async (issue: CodeScanIssue | IssueItem, filePath: string) => {
370-
console.log('in open security')
371370
const targetIssue: CodeScanIssue = issue instanceof IssueItem ? issue.issue : issue
372371
const targetFilePath: string = issue instanceof IssueItem ? issue.filePath : filePath
373372
await showSecurityIssueWebview(context.extensionContext, targetIssue, targetFilePath)
374-
console.log('in show securityIssueWebview')
375-
console.log('targetIssue', targetIssue)
376-
console.log('file Path', filePath)
377-
console.log('before', targetIssue.suggestedFixes.length === 0)
378373

379-
console.log('after', targetIssue.suggestedFixes.length === 0)
380374
if (targetIssue.suggestedFixes.length === 0) {
381-
console.log('going to generate fix as suggested fix length is 0')
382375
await generateFix.execute(targetIssue, targetFilePath, 'webview', true, false)
383376
}
384377

packages/core/src/codewhisperer/commands/startCodeFixGeneration.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55
import { fs } from '../../shared/fs/fs'
6-
// import { getLogger } from '../../shared/logger/logger'
6+
import { getLogger } from '../../shared/logger/logger'
77
import {
88
createCodeFixJob,
99
getCodeFixJob,
@@ -38,7 +38,7 @@ export async function startCodeFixGeneration(
3838
let linesOfFixGenerated
3939
let charsOfFixGenerated
4040
try {
41-
console.log(
41+
getLogger().verbose(
4242
`Starting code fix generation for lines ${issue.startLine + 1} through ${issue.endLine} of file ${filePath}`
4343
)
4444

@@ -91,30 +91,30 @@ export async function startCodeFixGeneration(
9191
}
9292
jobId = codeFixJob.jobId
9393
issue.fixJobId = codeFixJob.jobId
94-
console.log(`Created code fix job.`)
94+
getLogger().verbose(`Created code fix job.`)
9595

9696
/**
9797
* Step 4: Polling mechanism on code fix job status
9898
*/
9999
throwIfCancelled()
100100
const jobStatus = await pollCodeFixJobStatus(client, String(codeFixJob.jobId), profile)
101101
if (jobStatus === 'Failed') {
102-
console.log(`Code fix generation failed.`)
102+
getLogger().verbose(`Code fix generation failed.`)
103103
throw new CreateCodeFixError()
104104
}
105105

106106
/**
107107
* Step 5: Process and render code fix results
108108
*/
109109
throwIfCancelled()
110-
console.log(`Code fix job succeeded and start processing result.`)
110+
getLogger().verbose(`Code fix job succeeded and start processing result.`)
111111

112112
const { suggestedFix } = await getCodeFixJob(client, String(codeFixJob.jobId), profile)
113113
// eslint-disable-next-line aws-toolkits/no-json-stringify-in-log
114-
console.log(`Suggested fix: ${JSON.stringify(suggestedFix)}`)
114+
getLogger().verbose(`Suggested fix: ${JSON.stringify(suggestedFix)}`)
115115
return { suggestedFix, jobId }
116116
} catch (err) {
117-
console.log('Code fix generation failed: %s', err)
117+
getLogger().error('Code fix generation failed: %s', err)
118118
throw err
119119
} finally {
120120
codeFixState.setToNotStarted()

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,6 @@ export class TelemetryHelper {
877877
result?: string,
878878
includesFix?: boolean
879879
) {
880-
// eslint-disable-next-line aws-toolkits/no-console-log
881-
console.log('sending telemetry')
882880
client
883881
.sendTelemetryEvent({
884882
telemetryEvent: {
@@ -909,12 +907,6 @@ export class TelemetryHelper {
909907
if (isAwsError(error)) {
910908
requestId = error.requestId
911909
}
912-
// eslint-disable-next-line aws-toolkits/no-console-log
913-
console.log(
914-
`Failed to sendCodeScanRemediationsEvent to CodeWhisperer, requestId: ${
915-
requestId ?? ''
916-
}, message: ${error.message}`
917-
)
918910
getLogger().debug(
919911
`Failed to sendCodeScanRemediationsEvent to CodeWhisperer, requestId: ${
920912
requestId ?? ''

0 commit comments

Comments
 (0)