mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-06-12 03:13:39 -07:00
Fix Windows mpv logging and add log export (#88)
This commit is contained in:
@@ -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),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user