mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-02 21:50:52 +00:00
refactor(insightCommand): replace console.error with logger for better error handling
This commit is contained in:
parent
e66c203cb0
commit
4b95854e6c
4 changed files with 123 additions and 191 deletions
|
|
@ -12,6 +12,9 @@ import { t } from '../../i18n/index.js';
|
|||
import { join } from 'path';
|
||||
import os from 'os';
|
||||
import { StaticInsightGenerator } from '../../services/insight/generators/StaticInsightGenerator.js';
|
||||
import { createDebugLogger } from '@qwen-code/qwen-code-core';
|
||||
|
||||
const logger = createDebugLogger('DataProcessor');
|
||||
|
||||
// Open file in default browser
|
||||
async function openFileInBrowser(filePath: string): Promise<void> {
|
||||
|
|
@ -118,7 +121,7 @@ export const insightCommand: SlashCommand = {
|
|||
Date.now(),
|
||||
);
|
||||
} catch (browserError) {
|
||||
console.error('Failed to open browser automatically:', browserError);
|
||||
logger.error('Failed to open browser automatically:', browserError);
|
||||
|
||||
context.ui.addItem(
|
||||
{
|
||||
|
|
@ -149,7 +152,7 @@ export const insightCommand: SlashCommand = {
|
|||
Date.now(),
|
||||
);
|
||||
|
||||
console.error('Insight generation error:', error);
|
||||
logger.error('Insight generation error:', error);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue