Skip to content

Commit d704f0b

Browse files
committed
refactor(logging): Remove [DEBUG] prefix from log messages
1 parent 06200a9 commit d704f0b

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/extension.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const outputChannel = vscode.window.createOutputChannel('IAM Action Snipp
88

99
export function log(message: string) {
1010
if (DEBUG_ENABLED) {
11-
outputChannel.appendLine(message);
11+
outputChannel.appendLine(`[DEBUG] ${message}`);
1212
}
1313
}
1414

@@ -363,12 +363,12 @@ async function isBelowActionKey(document: vscode.TextDocument, position: vscode.
363363
const currentLineIndex = position.line;
364364
const currentLine = allLines[currentLineIndex] || '';
365365
const currentIndent = currentLine.search(/\S/);
366-
log(`[DEBUG] [YAML] Current line (${currentLineIndex}): ${currentLine}`);
367-
log(`[DEBUG] [YAML] Current indent: ${currentIndent}`);
366+
log(`[YAML] Current line (${currentLineIndex}): ${currentLine}`);
367+
log(`[YAML] Current indent: ${currentIndent}`);
368368

369369
// If the current line itself is a key, disable autocomplete.
370370
if (/^[-\s]*\w+\s*:/.test(currentLine)) {
371-
log('[DEBUG] [YAML] Current line appears to be a key, disabling autocomplete');
371+
log('[YAML] Current line appears to be a key, disabling autocomplete');
372372
return false;
373373
}
374374

@@ -382,18 +382,18 @@ async function isBelowActionKey(document: vscode.TextDocument, position: vscode.
382382
if (!line.includes(':')) {
383383
continue;
384384
}
385-
log(`[DEBUG] [YAML] Scanning line ${i}: ${line}`);
385+
log(`[YAML] Scanning line ${i}: ${line}`);
386386
const match = line.match(/^([ \t]*)(?:-\s*)?(\w+)\s*:/);
387387
if (match) {
388388
const parentIndent = match[1].length;
389389
if (parentIndent < currentIndent) {
390390
const parentKey = match[2].toLowerCase();
391-
log(`[DEBUG] [YAML] Found parent key: ${parentKey} at indent: ${parentIndent}`);
391+
log(`[YAML] Found parent key: ${parentKey} at indent: ${parentIndent}`);
392392
if (parentKey === 'action') {
393-
log(`[DEBUG] [YAML] Position is under 'action' key, enabling autocomplete`);
393+
log(`[YAML] Position is under 'action' key, enabling autocomplete`);
394394
return true;
395395
}
396-
log(`[DEBUG] [YAML] Parent key is not 'action', stopping search.`);
396+
log(`[YAML] Parent key is not 'action', stopping search.`);
397397
break;
398398
}
399399
}
@@ -406,18 +406,18 @@ async function isBelowActionKey(document: vscode.TextDocument, position: vscode.
406406
const currentLineIndex = position.line;
407407
const currentLine = allLines[currentLineIndex] || '';
408408
const currentIndent = currentLine.search(/\S/);
409-
log(`[DEBUG] [TS] Current line (${currentLineIndex}): ${currentLine}`);
410-
log(`[DEBUG] [TS] Current indent: ${currentIndent}`);
409+
log(`[TS] Current line (${currentLineIndex}): ${currentLine}`);
410+
log(`[TS] Current indent: ${currentIndent}`);
411411

412412
const actionsRegex = /actions\s*:\s*\[/;
413413
for (let i = currentLineIndex; i >= 0; i--) {
414414
const line = allLines[i];
415-
log(`[DEBUG] [TS] Scanning line ${i}: ${line}`);
415+
log(`[TS] Scanning line ${i}: ${line}`);
416416
if (actionsRegex.test(line)) {
417417
const match = line.match(/^(\s*)/);
418418
const parentIndent = match ? match[1].length : 0;
419419
if (currentIndent > parentIndent) {
420-
log(`[DEBUG] [TS] Found actions array starting at line ${i}, enabling autocomplete`);
420+
log(`[TS] Found actions array starting at line ${i}, enabling autocomplete`);
421421
return true;
422422
}
423423
break;
@@ -431,18 +431,18 @@ async function isBelowActionKey(document: vscode.TextDocument, position: vscode.
431431
const currentLineIndex = position.line;
432432
const currentLine = allLines[currentLineIndex] || '';
433433
const currentIndent = currentLine.search(/\S/);
434-
log(`[DEBUG] [Python] Current line (${currentLineIndex}): ${currentLine}`);
435-
log(`[DEBUG] [Python] Current indent: ${currentIndent}`);
434+
log(`[Python] Current line (${currentLineIndex}): ${currentLine}`);
435+
log(`[Python] Current indent: ${currentIndent}`);
436436

437437
const actionsRegex = /actions\s*=\s*\[/;
438438
for (let i = currentLineIndex; i >= 0; i--) {
439439
const line = allLines[i];
440-
log(`[DEBUG] [Python] Scanning line ${i}: ${line}`);
440+
log(`[Python] Scanning line ${i}: ${line}`);
441441
if (actionsRegex.test(line)) {
442442
const match = line.match(/^(\s*)/);
443443
const parentIndent = match ? match[1].length : 0;
444444
if (currentIndent > parentIndent) {
445-
log(`[DEBUG] [Python] Found actions list starting at line ${i}, enabling autocomplete`);
445+
log(`[Python] Found actions list starting at line ${i}, enabling autocomplete`);
446446
return true;
447447
}
448448
break;

0 commit comments

Comments
 (0)