mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 11:04:42 -07:00
Migrate console to coreEvents.emitFeedback or debugLogger (#15219)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import * as fs from 'node:fs/promises';
|
||||
import * as path from 'node:path';
|
||||
import { isNodeError, Storage } from '@google/gemini-cli-core';
|
||||
import { debugLogger, isNodeError, Storage } from '@google/gemini-cli-core';
|
||||
|
||||
const MAX_HISTORY_LENGTH = 100;
|
||||
|
||||
@@ -52,7 +52,7 @@ async function readHistoryFile(filePath: string): Promise<string[]> {
|
||||
return result;
|
||||
} catch (err) {
|
||||
if (isNodeError(err) && err.code === 'ENOENT') return [];
|
||||
console.error('Error reading history:', err);
|
||||
debugLogger.error('Error reading history:', err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ async function writeHistoryFile(
|
||||
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
||||
await fs.writeFile(filePath, history.join('\n'));
|
||||
} catch (error) {
|
||||
console.error('Error writing shell history:', error);
|
||||
debugLogger.error('Error writing shell history:', error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user