feat(cli): migrate console calls to debugLogger and stdioHelpers (M3 Phase 7-9)

Route CLI console.* calls to structured logging:
- Debug/internal diagnostics → debugLogger (logfile)
- User-facing output → writeStdoutLine/writeStderrLine/clearScreen (stdioHelpers)
- Add stdioHelpers.ts with writeStdoutLine, writeStderrLine, clearScreen
- Migrate pre-session files (gemini.tsx, sandbox.ts, config.ts) to stdioHelpers
- Migrate extension/MCP commands to stdioHelpers
- Migrate non-interactive session/control to debugLogger
- Migrate UI hooks and components to debugLogger
This commit is contained in:
tanzhenxin 2026-01-26 15:02:37 +08:00
parent 45df0e8b82
commit 7995c65571
82 changed files with 606 additions and 485 deletions

View file

@ -5,6 +5,7 @@
*/
import { useReducer, useRef, useEffect } from 'react';
import { createDebugLogger } from '@qwen-code/qwen-code-core';
import { useKeypress } from './useKeypress.js';
export interface SelectionListItem<T> {
@ -22,6 +23,8 @@ export interface UseSelectionListOptions<T> {
showNumbers?: boolean;
}
const debugLogger = createDebugLogger('SELECTION_LIST');
export interface UseSelectionListResult {
activeIndex: number;
setActiveIndex: (index: number) => void;
@ -203,7 +206,7 @@ function selectionListReducer<T>(
default: {
const exhaustiveCheck: never = action;
console.error(`Unknown selection list action: ${exhaustiveCheck}`);
debugLogger.error(`Unknown selection list action: ${exhaustiveCheck}`);
return state;
}
}