From 0c24e392a40510a974cf5207ae0fe2fe27a98213 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 12:49:09 +0100 Subject: [PATCH] feat(patch): add log level environment variable (w/ docs); change fallback release to `1.0.0` --- Makefile | 1 + README.md | 5 ++ .../09-log-level-environment-variable.patch | 60 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 patches/09-log-level-environment-variable.patch diff --git a/Makefile b/Makefile index b9e3e8d..fd848d6 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,7 @@ prepare: clean install_build_deps @echo "06 - Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" @echo "07 - Add Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/82)" @echo "08 - Add option to disable Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/95)" + @echo "09 - Add environment variable to change log level (https://github.com/aunetx/deezer-linux/pull/95)" $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" diff --git a/README.md b/README.md index cb907c6..b9515a7 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,11 @@ Other packages can be installed from you package manager, either by clicking on | `--disable-features` | Disable some features (see [patch](./patches/06-better-management-of-MPRIS.patch)) | | `--disable-discord-rpc` | Disable Discord RPC integration (see [patch](./patches/08-discord-rich-presence-disable.patch)) | +| Environment variable | Options | Description | +| -------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `LOG_LEVEL` | `silly`,`debug`,`verbose`,`info`,`warning`,`error` | Set the log level (see [patch](./patches/09-log-level-environment-variable.patch)) | +| `DZ_DEVTOOLS` | `yes`,`no` | Enable the developer console (ctrl+shift+i) | + ## Building from source ### Available targets diff --git a/patches/09-log-level-environment-variable.patch b/patches/09-log-level-environment-variable.patch new file mode 100644 index 0000000..db5b901 --- /dev/null +++ b/patches/09-log-level-environment-variable.patch @@ -0,0 +1,60 @@ +From 93a932ba99e8125169eeb512fa6f9a89a70eeb1e Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Sat, 1 Feb 2025 12:42:07 +0100 +Subject: [PATCH] feat: add log level env variable + +--- + build/main.js | 30 +++++++++++++++++++++++++++++- + 1 file changed, 29 insertions(+), 1 deletion(-) + +diff --git a/build/main.js b/build/main.js +index 8b645c6..c62943b 100644 +--- a/build/main.js ++++ b/build/main.js +@@ -12,7 +12,7 @@ + var result = release.match(matcher); + if (result[1]) + return result[1]; +- return "0.0.0"; ++ return "1.0.0"; + } + module.exports = __module_os; + }, +@@ -67,6 +67,34 @@ + var external_electron_log_default = __webpack_require__.n( + external_electron_log_namespaceObject + ); ++ function updateLogLevel() { ++ if (process.env.LOG_LEVEL) { ++ if (process.env.LOG_LEVEL !== "silly") ++ external_electron_log_default().silly = () => {}; ++ else return; ++ ++ if (process.env.LOG_LEVEL !== "debug") ++ external_electron_log_default().debug = () => {}; ++ else return; ++ ++ if (process.env.LOG_LEVEL !== "verbose") ++ external_electron_log_default().verbose = () => {}; ++ else return; ++ ++ if (process.env.LOG_LEVEL !== "info") ++ external_electron_log_default().info = () => {}; ++ else return; ++ ++ if (process.env.LOG_LEVEL !== "warn") ++ external_electron_log_default().warn = () => {}; ++ else return; ++ ++ if (process.env.LOG_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 +-- +2.43.0 +