Fix Windows mpv logging and add log export (#88)

This commit is contained in:
2026-05-26 00:31:38 -07:00
committed by GitHub
parent 43ebc7d371
commit 11c196821d
150 changed files with 2748 additions and 582 deletions
+3
View File
@@ -1,6 +1,7 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { AnkiConnectClient } from './anki-connect';
import { setLogLevel } from './logger';
test('AnkiConnectClient disables keep-alive agents to avoid stale socket retries', () => {
const client = new AnkiConnectClient('http://127.0.0.1:8765') as unknown as {
@@ -36,6 +37,7 @@ test('AnkiConnectClient includes action name in retry logs', async () => {
const originalInfo = console.info;
const messages: string[] = [];
setLogLevel('info');
try {
console.info = (...args: unknown[]) => {
messages.push(args.map((value) => String(value)).join(' '));
@@ -46,6 +48,7 @@ test('AnkiConnectClient includes action name in retry logs', async () => {
assert.match(messages.join('\n'), /AnkiConnect notesInfo retry 1\/3 after 200ms delay/);
} finally {
console.info = originalInfo;
setLogLevel(undefined);
}
});