-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path09-log-level-environment-variable.patch
72 lines (69 loc) · 2.75 KB
/
09-log-level-environment-variable.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From 43e2a95ada8852ffda95a9ea08bb7914d26c6d2f Mon Sep 17 00:00:00 2001
From: josselinonduty <[email protected]>
Date: Sat, 1 Feb 2025 19:05:39 +0100
Subject: [PATCH] fix: set default log level to "warn" to respect Deezer TOS
Original patch: Dorian Stoll <[email protected]>
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 | 39 ++++++++++++++++++++++++++++++++++-----
1 file changed, 34 insertions(+), 5 deletions(-)
diff --git a/build/main.js b/build/main.js
index 8b645c6..686ac80 100644
--- a/build/main.js
+++ b/build/main.js
@@ -67,6 +67,35 @@
var external_electron_log_default = __webpack_require__.n(
external_electron_log_namespaceObject
);
+ // function updateLogLevel() {
+ // const level = process.env.LOG_LEVEL;
+ // if (level) {
+ // if (level !== "silly")
+ // external_electron_log_default().silly = () => {};
+ // else return;
+
+ // if (level !== "debug")
+ // external_electron_log_default().debug = () => {};
+ // else return;
+
+ // if (level !== "verbose")
+ // external_electron_log_default().verbose = () => {};
+ // else return;
+
+ // if (level !== "info")
+ // external_electron_log_default().info = () => {};
+ // else return;
+
+ // if (level !== "warn")
+ // external_electron_log_default().warn = () => {};
+ // else return;
+
+ // if (level !== "error")
+ // external_electron_log_default().error = () => {};
+ // else return;
+ // }
+ // }
+ // updateLogLevel();
const external_electron_settings_namespaceObject = require("electron-settings");
var external_electron_settings_default = __webpack_require__.n(
external_electron_settings_namespaceObject
@@ -3329,11 +3358,11 @@
(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"
+ (external_electron_log_default().transports.console.level = isDev({isPackaged: true}) || process.env.LOG_LEVEL
+ ? process.env.LOG_LEVEL
: "warn"),
- (external_electron_log_default().transports.file.level = isDev
- ? "silly"
+ (external_electron_log_default().transports.file.level = isDev({isPackaged: true}) || !process.env.LOG_LEVEL
+ ? process.env.LOG_LEVEL
: "warn"),
(external_electron_log_default().transports.sentry = function (msg) {
"error" === msg.level &&
--
2.43.0