diff --git a/packages/agents-a365-observability/src/utils/logging.ts b/packages/agents-a365-observability/src/utils/logging.ts index 9a77f865..d8da4664 100644 --- a/packages/agents-a365-observability/src/utils/logging.ts +++ b/packages/agents-a365-observability/src/utils/logging.ts @@ -201,9 +201,10 @@ export function setLogger(customLogger: ILogger): void { !customLogger || typeof customLogger.info !== 'function' || typeof customLogger.warn !== 'function' || - typeof customLogger.error !== 'function' + typeof customLogger.error !== 'function' || + typeof customLogger.event !== 'function' ) { - throw new Error('Custom logger must implement ILogger interface (info, warn, error methods)'); + throw new Error('Custom logger must implement ILogger interface (info, warn, error, event methods)'); } globalLogger = customLogger; } diff --git a/tests/observability/core/custom-logger.test.ts b/tests/observability/core/custom-logger.test.ts index c8f914e4..eed4a24c 100644 --- a/tests/observability/core/custom-logger.test.ts +++ b/tests/observability/core/custom-logger.test.ts @@ -86,14 +86,14 @@ describe('Custom Logger Support', () => { describe('Global Logger Management', () => { it('should set and get custom logger', () => { - const custom: ILogger = { info: jest.fn(), warn: jest.fn(), error: jest.fn() }; + const custom: ILogger = { info: jest.fn(), warn: jest.fn(), error: jest.fn(), event: jest.fn() }; setLogger(custom); expect(getLogger()).toBe(custom); }); it('should reset to default logger', () => { - const custom: ILogger = { info: jest.fn(), warn: jest.fn(), error: jest.fn() }; + const custom: ILogger = { info: jest.fn(), warn: jest.fn(), error: jest.fn(), event: jest.fn() }; setLogger(custom); resetLogger(); @@ -111,7 +111,8 @@ describe('Custom Logger Support', () => { const customLogger: ILogger = { info: jest.fn(), warn: jest.fn(), - error: jest.fn() + error: jest.fn(), + event: jest.fn() }; setLogger(customLogger); @@ -130,7 +131,8 @@ describe('Custom Logger Support', () => { const selectiveLogger: ILogger = { info: () => {}, warn: jest.fn(), - error: () => {} + error: () => {}, + event: () => {} }; setLogger(selectiveLogger); @@ -149,7 +151,8 @@ describe('Custom Logger Support', () => { const customLogger: ILogger = { info: jest.fn(), warn: jest.fn(), - error: jest.fn() + error: jest.fn(), + event: jest.fn() }; new ObservabilityBuilder()