deezer-linux/patches/07-log-level-environment-variable.patch
2025-11-30 23:25:58 +01:00

47 lines
1.8 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 32888596092dd2bded632299af0782a1eb871f18 Mon Sep 17 00:00:00 2001
From: josselinonduty <contact@josselinonduty.fr>
Date: Sun, 30 Nov 2025 22:37:18 +0100
Subject: [PATCH] fix: set default log level to "warn" to respect Deezer TOS;
control log level from environment variable
Original patch: Dorian Stoll <dorian.stoll@tmsp.io>
This stops the excessive logging, since parts of the app will not run in development
mode anymore. It also stops the app from logging the urls for the mp3 files, which is
against the Deezer TOS.
---
build/main.js | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/build/main.js b/build/main.js
index 481fc5c..b141aa2 100644
--- a/build/main.js
+++ b/build/main.js
@@ -3316,12 +3316,18 @@
processType: isProcessMain() ? "main" : process.type,
}),
(external_electron_log_default().transports.console.format = `{h}:{i}:{s}.{ms} ({processType}/{level}) ${isPlatform(PLATFORM.WINDOWS) ? ">" : ""} {text}`),
- (external_electron_log_default().transports.console.level = isDev
- ? "silly"
- : "warn"),
- (external_electron_log_default().transports.file.level = isDev
- ? "silly"
- : "warn"),
+ (external_electron_log_default().transports.console.level =
+ (process.argv.find((arg) => arg.startsWith("--log-level=")) || "").split(
+ "="
+ )[1] ||
+ process.env.DZ_LOG_LEVEL ||
+ "warn"),
+ (external_electron_log_default().transports.file.level =
+ (process.argv.find((arg) => arg.startsWith("--log-level=")) || "").split(
+ "="
+ )[1] ||
+ process.env.DZ_LOG_LEVEL ||
+ "warn"),
(external_electron_log_default().transports.sentry = function (msg) {
"error" === msg.level &&
(msg.data[0] instanceof Error
--
2.48.1