From 5c8e3fd5ba2b8b1534f4acbd329335511ee98591 Mon Sep 17 00:00:00 2001 From: "CATERPILLAR\\Braxen" Date: Thu, 18 Jan 2024 15:08:42 +0100 Subject: [PATCH] customisable streamlink log level --- common/ServerConfig.ts | 17 +++++++++++++++++ server/src/Core/Providers/Base/BaseAutomator.ts | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/common/ServerConfig.ts b/common/ServerConfig.ts index 0c69d343..e75a8136 100644 --- a/common/ServerConfig.ts +++ b/common/ServerConfig.ts @@ -303,6 +303,23 @@ export const settingsFields: Record = { help: "If set to -1, it will be ignored. 0 disables the check.", }, + "capture.loglevel": { + group: "Capture", + text: "Capture log level", + type: "object", + default: "info", + choices: { + none: "None", + critical: "Critical", + error: "Error", + warning: "Warning", + info: "Info", + debug: "Debug", + trace: "Trace", + all: "All", + }, + }, + "capture.use_cache": { group: "Capture", text: "Use cache", diff --git a/server/src/Core/Providers/Base/BaseAutomator.ts b/server/src/Core/Providers/Base/BaseAutomator.ts index 63f7acad..22021110 100644 --- a/server/src/Core/Providers/Base/BaseAutomator.ts +++ b/server/src/Core/Providers/Base/BaseAutomator.ts @@ -1638,7 +1638,9 @@ export class BaseAutomator { cmd.push("--retry-max", "5"); // logging level - if (Config.debug) { + if (Config.getInstance().cfg("capture.loglevel", "info") !== "info") { + cmd.push("--loglevel", Config.getInstance().cfg("capture.loglevel", "info")); + } else if (Config.debug) { cmd.push("--loglevel", "debug"); } else if (Config.getInstance().cfg("app_verbose", false)) { cmd.push("--loglevel", "info");