import { vi } from "../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_fc26da61d3f761277fbc021fa297f7ea/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js";

//#region src/test-utils/mocks/logger.ts
/**
* Shared mock factories for the logger module.
*
* These utilities require `vitest` in the consumer's environment — they
* import `vi` from `vitest` to create mock functions. Only use in test files
* where vitest is already available as a devDependency.
*/
function createMockLogger() {
	const mockLogger = {
		info: vi.fn(),
		warn: vi.fn(),
		error: vi.fn(),
		debug: vi.fn(),
		child: vi.fn(),
		with: vi.fn(),
		getPinoInstance: vi.fn().mockReturnValue({
			info: vi.fn(),
			warn: vi.fn(),
			error: vi.fn(),
			debug: vi.fn(),
			child: vi.fn().mockReturnThis()
		})
	};
	mockLogger.child.mockReturnValue(mockLogger);
	mockLogger.with.mockReturnValue(mockLogger);
	return mockLogger;
}
function createMockLoggerModule() {
	const mockLogger = createMockLogger();
	const module = {
		getLogger: vi.fn(() => mockLogger),
		runWithLogContext: vi.fn((_bindings, fn) => fn())
	};
	return {
		mockLogger,
		module,
		clearAll: () => {
			for (const fn of Object.values(mockLogger)) if (typeof fn === "function" && "mockClear" in fn) fn.mockClear();
			for (const fn of Object.values(module)) if (typeof fn === "function" && "mockClear" in fn) fn.mockClear();
		}
	};
}

//#endregion
export { createMockLogger, createMockLoggerModule };