Skip to content

Commit d482d4b

Browse files
committed
clean debug outputs
1 parent 8786815 commit d482d4b

File tree

4 files changed

+0
-66
lines changed

4 files changed

+0
-66
lines changed

packages/core/src/amazonq/autoDebug/diagnostics/diagnosticsMonitor.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export class DiagnosticsMonitor implements vscode.Disposable {
4141
// Monitor diagnostic changes from all language servers
4242
this.disposables.push(
4343
vscode.languages.onDidChangeDiagnostics((event) => {
44-
this.logger.debug('DiagnosticsMonitor: Diagnostic change detected for %d URIs', event.uris.length)
4544
this.handleDiagnosticChange(event)
4645
})
4746
)
@@ -119,8 +118,6 @@ export class DiagnosticsMonitor implements vscode.Disposable {
119118
* Captures a baseline snapshot of current diagnostics
120119
*/
121120
public async captureBaseline(): Promise<DiagnosticSnapshot> {
122-
this.logger.debug('DiagnosticsMonitor: Capturing diagnostic baseline')
123-
124121
const diagnostics = await this.getCurrentDiagnostics(false)
125122
const snapshot: DiagnosticSnapshot = {
126123
diagnostics,
@@ -168,7 +165,6 @@ export class DiagnosticsMonitor implements vscode.Disposable {
168165

169166
// Only emit if diagnostics actually changed
170167
if (!this.lastDiagnostics || !this.areDiagnosticsEqual(this.lastDiagnostics, currentDiagnostics)) {
171-
this.logger.debug('DiagnosticsMonitor: Emitting diagnostic change event')
172168
this.lastDiagnostics = currentDiagnostics
173169
this.diagnosticsChangeEmitter.fire(currentDiagnostics)
174170
}
@@ -230,8 +226,6 @@ export class DiagnosticsMonitor implements vscode.Disposable {
230226
}
231227

232228
public dispose(): void {
233-
this.logger.debug('DiagnosticsMonitor: Disposing diagnostic monitor')
234-
235229
if (this.debounceTimer) {
236230
clearTimeout(this.debounceTimer)
237231
}

packages/core/src/amazonq/autoDebug/diagnostics/errorContext.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ export class ErrorContextFormatter {
4545
* Converts a Problem to detailed ErrorContext
4646
*/
4747
public async createErrorContext(problem: Problem): Promise<ErrorContext> {
48-
this.logger.debug(
49-
'ErrorContextFormatter: Creating error context for %s at line %d',
50-
problem.uri.fsPath,
51-
problem.diagnostic.range.start.line + 1
52-
)
53-
5448
const surroundingCode = await this.extractSurroundingCode(problem.uri, problem.diagnostic.range)
5549

5650
const context: ErrorContext = {
@@ -67,17 +61,13 @@ export class ErrorContextFormatter {
6761
relatedInformation: problem.diagnostic.relatedInformation,
6862
surroundingCode,
6963
}
70-
71-
this.logger.debug('ErrorContextFormatter: Created error context for %s', context.location.file)
7264
return context
7365
}
7466

7567
/**
7668
* Formats multiple error contexts into a comprehensive report
7769
*/
7870
public formatErrorReport(contexts: ErrorContext[]): FormattedErrorReport {
79-
this.logger.debug('ErrorContextFormatter: Formatting error report for %d contexts', contexts.length)
80-
8171
const summary = this.createSummary(contexts)
8272
const details = this.createDetails(contexts)
8373
const contextualCode = this.createContextualCode(contexts)
@@ -95,8 +85,6 @@ export class ErrorContextFormatter {
9585
* Formats a single error context for display
9686
*/
9787
public formatSingleError(context: ErrorContext): string {
98-
this.logger.debug('ErrorContextFormatter: Formatting single error for %s', context.location.file)
99-
10088
const parts = [
10189
`**${context.severity.toUpperCase()}** in ${context.location.file}`,
10290
`Line ${context.location.line}, Column ${context.location.column}`,
@@ -134,8 +122,6 @@ export class ErrorContextFormatter {
134122
* Creates a problems string similar to the reference implementation
135123
*/
136124
public formatProblemsString(problems: Problem[], cwd: string): string {
137-
this.logger.debug('ErrorContextFormatter: Formatting problems string for %d problems', problems.length)
138-
139125
let result = ''
140126
const fileGroups = this.groupProblemsByFile(problems)
141127

packages/core/src/amazonq/autoDebug/diagnostics/problemDetector.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import * as vscode from 'vscode'
77
import * as path from 'path'
8-
import { getLogger } from '../../../shared/logger/logger'
98
import { DiagnosticCollection, DiagnosticSnapshot } from './diagnosticsMonitor'
109
import { mapDiagnosticSeverity } from '../shared/diagnosticUtils'
1110

@@ -28,22 +27,10 @@ export interface CategorizedProblems {
2827
* Detects new problems by comparing diagnostic snapshots and filtering relevant issues.
2928
*/
3029
export class ProblemDetector {
31-
private readonly logger = getLogger('amazonqLsp')
32-
33-
constructor() {
34-
this.logger.debug('ProblemDetector: Initializing problem detector')
35-
}
36-
3730
/**
3831
* Detects new problems by comparing baseline and current diagnostics
3932
*/
4033
public detectNewProblems(baseline: DiagnosticSnapshot, current: DiagnosticSnapshot): Problem[] {
41-
this.logger.debug(
42-
'ProblemDetector: Detecting new problems between baseline %s and current %s',
43-
baseline.id,
44-
current.id
45-
)
46-
4734
const newProblems: Problem[] = []
4835
const baselineMap = this.createDiagnosticMap(baseline.diagnostics)
4936

@@ -56,21 +43,13 @@ export class ProblemDetector {
5643
}
5744
}
5845
}
59-
60-
this.logger.debug('ProblemDetector: Found %d new problems', newProblems.length)
6146
return newProblems
6247
}
6348

6449
/**
6550
* Filters problems to only include those relevant to changed files
6651
*/
6752
public filterRelevantProblems(problems: Problem[], changedFiles: string[]): Problem[] {
68-
this.logger.debug(
69-
'ProblemDetector: Filtering %d problems for %d changed files',
70-
problems.length,
71-
changedFiles.length
72-
)
73-
7453
if (changedFiles.length === 0) {
7554
return problems
7655
}
@@ -81,17 +60,13 @@ export class ProblemDetector {
8160
const problemFile = path.normalize(problem.uri.fsPath)
8261
return changedFileSet.has(problemFile) || this.isRelatedFile(problemFile, changedFiles)
8362
})
84-
85-
this.logger.debug('ProblemDetector: Filtered to %d relevant problems', relevantProblems.length)
8663
return relevantProblems
8764
}
8865

8966
/**
9067
* Categorizes problems by severity level
9168
*/
9269
public categorizeBySeverity(problems: Problem[]): CategorizedProblems {
93-
this.logger.debug('ProblemDetector: Categorizing %d problems by severity', problems.length)
94-
9570
const categorized: CategorizedProblems = {
9671
errors: [],
9772
warnings: [],
@@ -115,45 +90,28 @@ export class ProblemDetector {
11590
break
11691
}
11792
}
118-
119-
this.logger.debug(
120-
'ProblemDetector: Categorized problems - errors: %d, warnings: %d, info: %d, hints: %d',
121-
categorized.errors.length,
122-
categorized.warnings.length,
123-
categorized.info.length,
124-
categorized.hints.length
125-
)
126-
12793
return categorized
12894
}
12995

13096
/**
13197
* Gets all problems from a diagnostic collection
13298
*/
13399
public getAllProblems(diagnostics: DiagnosticCollection): Problem[] {
134-
this.logger.debug('ProblemDetector: Converting diagnostic collection to problems')
135-
136100
const problems: Problem[] = []
137101

138102
for (const [uri, fileDiagnostics] of diagnostics.diagnostics) {
139103
for (const diagnostic of fileDiagnostics) {
140104
problems.push(this.createProblem(uri, diagnostic, false))
141105
}
142106
}
143-
144-
this.logger.debug('ProblemDetector: Converted %d diagnostics to problems', problems.length)
145107
return problems
146108
}
147109

148110
/**
149111
* Filters problems by source (TypeScript, ESLint, etc.)
150112
*/
151113
public filterBySource(problems: Problem[], sources: string[]): Problem[] {
152-
this.logger.debug('ProblemDetector: Filtering problems by sources: %O', sources)
153-
154114
const filtered = problems.filter((problem) => sources.length === 0 || sources.includes(problem.source))
155-
156-
this.logger.debug('ProblemDetector: Filtered to %d problems', filtered.length)
157115
return filtered
158116
}
159117

packages/core/src/amazonq/autoDebug/ide/contextMenuProvider.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,11 @@ export class ContextMenuProvider implements vscode.Disposable {
200200
* Starts a new auto debug session
201201
*/
202202
private async startAutoDebugSession(): Promise<void> {
203-
this.logger.debug('ContextMenuProvider: Starting auto debug session')
204-
205203
try {
206204
const session = await this.autoDebugController.startSession()
207205
void vscode.window.showInformationMessage(
208206
`Auto Debug session started (ID: ${session.id.substring(0, 8)}...)`
209207
)
210-
this.logger.debug('ContextMenuProvider: Auto debug session started successfully')
211208
} catch (error) {
212209
this.logger.error('ContextMenuProvider: Error starting auto debug session: %s', error)
213210
void vscode.window.showErrorMessage('Failed to start Auto Debug session')
@@ -223,7 +220,6 @@ export class ContextMenuProvider implements vscode.Disposable {
223220
try {
224221
await this.autoDebugController.endSession()
225222
void vscode.window.showInformationMessage('Auto Debug session ended')
226-
this.logger.debug('ContextMenuProvider: Auto debug session ended successfully')
227223
} catch (error) {
228224
this.logger.error('ContextMenuProvider: Error ending auto debug session: %s', error)
229225
void vscode.window.showErrorMessage('Failed to end Auto Debug session')

0 commit comments

Comments
 (0)