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
+11 -1
View File
@@ -2,21 +2,28 @@ import path from 'node:path';
import { loadRawConfigStrict } from './config/load';
import { resolveConfig } from './config/resolve';
import type { MpvLaunchMode, ResolvedConfig } from './types/config';
import type { LogFileToggles, LogRotation } from './shared/log-files';
import type { SharedLogLevel } from './shared/mpv-logging-args';
import type { SubminerPluginRuntimeScriptOptConfig } from './shared/subminer-plugin-script-opts';
export interface ConfiguredWindowsMpvLaunch {
executablePath: string;
launchMode: MpvLaunchMode;
logLevel: SharedLogLevel;
logRotation: LogRotation;
logFiles: LogFileToggles;
pluginRuntimeConfig: SubminerPluginRuntimeScriptOptConfig;
}
export function buildWindowsMpvPluginRuntimeConfig(
config: Pick<ResolvedConfig, 'auto_start_overlay' | 'mpv' | 'texthooker'>,
config: Pick<ResolvedConfig, 'auto_start_overlay' | 'logging' | 'mpv' | 'texthooker'>,
): SubminerPluginRuntimeScriptOptConfig {
return {
socketPath: config.mpv.socketPath,
binaryPath: config.mpv.subminerBinaryPath,
backend: config.mpv.backend,
logLevel: config.logging.level,
logRotation: config.logging.rotation,
autoStart: config.mpv.autoStartSubMiner,
autoStartVisibleOverlay: config.auto_start_overlay,
autoStartPauseUntilReady: config.mpv.pauseUntilOverlayReady,
@@ -38,6 +45,9 @@ export function readConfiguredWindowsMpvLaunch(configDir: string): ConfiguredWin
return {
executablePath: resolved.mpv.executablePath,
launchMode: resolved.mpv.launchMode,
logLevel: resolved.logging.level,
logRotation: resolved.logging.rotation,
logFiles: resolved.logging.files,
pluginRuntimeConfig: buildWindowsMpvPluginRuntimeConfig(resolved),
};
}