migrating console.error to debugger for installationManager, oauth-provider, modifiable-tool (#12279)

This commit is contained in:
Sehoon Shon
2025-10-31 14:17:51 -04:00
committed by GitHub
parent c158923b27
commit ab013fb7e9
5 changed files with 26 additions and 11 deletions

View File

@@ -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();
});
});
});

View File

@@ -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,
);