mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-30 07:51:07 -07:00
migrating console.error to debugger for installationManager, oauth-provider, modifiable-tool (#12279)
This commit is contained in:
@@ -91,14 +91,14 @@ describe('InstallationManager', () => {
|
||||
readSpy.mockImplementationOnce(() => {
|
||||
throw new Error('Read error');
|
||||
});
|
||||
const consoleErrorSpy = vi
|
||||
.spyOn(console, 'error')
|
||||
const consoleWarnSpy = vi
|
||||
.spyOn(console, 'warn')
|
||||
.mockImplementation(() => {});
|
||||
|
||||
const id = installationManager.getInstallationId();
|
||||
|
||||
expect(id).toBe('123456789');
|
||||
expect(consoleErrorSpy).toHaveBeenCalled();
|
||||
expect(consoleWarnSpy).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@ import * as fs from 'node:fs';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import * as path from 'node:path';
|
||||
import { Storage } from '../config/storage.js';
|
||||
import { debugLogger } from './debugLogger.js';
|
||||
|
||||
export class InstallationManager {
|
||||
private getInstallationIdPath(): string {
|
||||
@@ -48,7 +49,7 @@ export class InstallationManager {
|
||||
|
||||
return installationId;
|
||||
} catch (error) {
|
||||
console.error(
|
||||
debugLogger.warn(
|
||||
'Error accessing installation ID file, generating ephemeral ID:',
|
||||
error,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user