From efbbe441bbd586779074c387c63c714cd0cc9d1a Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 30 Nov 2025 23:25:58 +0100 Subject: [PATCH] feat(patch): update patch 07 --- README.md | 21 +++---- .../07-log-level-environment-variable.patch | 58 ++++++++++--------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 3dc6696..153ea9f 100644 --- a/README.md +++ b/README.md @@ -47,18 +47,19 @@ Other packages can be installed from you package manager, either by clicking on | `--hide-appoffline-banner` | Hide the "Application is offline" banner that appears when using a VPN or DNS blocker (see [patch](./patches/11-hide-appoffline-banner.patch)) | | `--disable-animations` | Disable animations (see [patch](./patches/12-disable-animations.patch)) | | `--disable-notifications` | Disable notifications (see [patch](./patches/13-disable-notifications.patch)) | +| `--log-level` | Set the log level (`silly`,`debug`,`verbose`,`info`,`warn`,`error`) (see [patch](./patches/07-log-level-environment-variable.patch)) | | `--enable-wayland-ime` `--ozone-platform-hint=auto` `--wayland-text-input-version=3` | Enable IME keyboard support on Wayland | -| Environment variable | Options | Description | -| --------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `DZ_START_IN_TRAY` | `yes`,`no` | Start the app in the tray (see [patch](./patches/01-start-hidden-in-tray.patch)) | -| `DZ_DISABLE_SYSTRAY` | `yes`,`no` | Quit the app when the window is closed (see [patch](./patches/03-quit.patch)) | -| `DZ_KEEP_KERNEL` | `yes`,`no` | Use the exact kernel version (see [patch](./patches/05-remove-os-information.patch)) | -| `DZ_HIDE_APPOFFLINE_BANNER` | `yes`,`no` | Hide the "Application is offline" banner (see [patch](./patches/11-hide-appoffline-banner.patch)) | -| `DZ_DISABLE_ANIMATIONS` | `yes`,`no` | Disable animations (see [patch](./patches/12-disable-animations.patch)) | -| `DZ_DISABLE_NOTIFICATIONS` | `yes`,`no` | Disable notifications (see [patch](./patches/13-disable-notifications.patch)) | -| `LOG_LEVEL` | `silly`,`debug`,`verbose`,`info`,`warning`,`error` | Set the log level (see [patch](./patches/07-log-level-environment-variable.patch)) | -| `DZ_DEVTOOLS` | `yes`,`no` | Enable the developer console (ctrl+shift+i) | +| Environment variable | Options | Description | +| --------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `DZ_START_IN_TRAY` | `yes`,`no` | Start the app in the tray (see [patch](./patches/01-start-hidden-in-tray.patch)) | +| `DZ_DISABLE_SYSTRAY` | `yes`,`no` | Quit the app when the window is closed (see [patch](./patches/03-quit.patch)) | +| `DZ_KEEP_KERNEL` | `yes`,`no` | Use the exact kernel version (see [patch](./patches/05-remove-os-information.patch)) | +| `DZ_HIDE_APPOFFLINE_BANNER` | `yes`,`no` | Hide the "Application is offline" banner (see [patch](./patches/11-hide-appoffline-banner.patch)) | +| `DZ_DISABLE_ANIMATIONS` | `yes`,`no` | Disable animations (see [patch](./patches/12-disable-animations.patch)) | +| `DZ_DISABLE_NOTIFICATIONS` | `yes`,`no` | Disable notifications (see [patch](./patches/13-disable-notifications.patch)) | +| `DZ_LOG_LEVEL` | `silly`,`debug`,`verbose`,`info`,`warn`,`error` | Set the log level (see [patch](./patches/07-log-level-environment-variable.patch)) | +| `DZ_DEVTOOLS` | `yes`,`no` | Enable the developer console (ctrl+shift+i) | ## Building from source diff --git a/patches/07-log-level-environment-variable.patch b/patches/07-log-level-environment-variable.patch index fda53f3..f93486a 100644 --- a/patches/07-log-level-environment-variable.patch +++ b/patches/07-log-level-environment-variable.patch @@ -1,6 +1,6 @@ -From 5cc1a232e85c96163cba700321df9079ea4e4379 Mon Sep 17 00:00:00 2001 +From 32888596092dd2bded632299af0782a1eb871f18 Mon Sep 17 00:00:00 2001 From: josselinonduty -Date: Wed, 14 May 2025 14:55:20 +0900 +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 @@ -9,34 +9,38 @@ This stops the excessive logging, since parts of the app will not run in develop mode anymore. It also stops the app from logging the urls for the mp3 files, which is against the Deezer TOS. --- - build/main.js | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) + build/main.js | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/build/main.js b/build/main.js -index eabc5e1..485b953 100644 +index 481fc5c..b141aa2 100644 --- a/build/main.js +++ b/build/main.js -@@ -3305,12 +3305,14 @@ - 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 = -+ isDev({ isPackaged: true }) || process.env.LOG_LEVEL -+ ? process.env.LOG_LEVEL -+ : "warn"), -+ (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 && - (msg.data[0] instanceof Error +@@ -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.43.0 +2.48.1