From 62dd58a4620a91a01a70a95b620134faf1368d7b Mon Sep 17 00:00:00 2001 From: Shaowen Yin Date: Thu, 25 Jan 2024 21:56:25 +0800 Subject: [PATCH] *: add FUO_LOG_TO_FILE envvar and enable it by default on pyinstaller env (#781) --- feeluown/entry_points/base.py | 3 ++- feeluown/pyinstaller/main.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/feeluown/entry_points/base.py b/feeluown/entry_points/base.py index 614a9de352..63d2f23b47 100644 --- a/feeluown/entry_points/base.py +++ b/feeluown/entry_points/base.py @@ -29,7 +29,8 @@ def setup_config(args, config): config.DEBUG = args.debug or config.DEBUG config.VERBOSE = args.verbose or config.VERBOSE config.MPV_AUDIO_DEVICE = args.mpv_audio_device or config.MPV_AUDIO_DEVICE - config.LOG_TO_FILE = bool(args.log_to_file or config.LOG_TO_FILE) + config.LOG_TO_FILE = bool(args.log_to_file or config.LOG_TO_FILE or + os.getenv('FUO_LOG_TO_FILE')) if args.cmd is not None: config.MODE = App.CliMode diff --git a/feeluown/pyinstaller/main.py b/feeluown/pyinstaller/main.py index fc214b6e6b..8cbb75b7ee 100644 --- a/feeluown/pyinstaller/main.py +++ b/feeluown/pyinstaller/main.py @@ -7,4 +7,5 @@ if hasattr(sys, '_MEIPASS'): os.chdir(sys._MEIPASS) + os.environ.setdefault('FUO_LOG_TO_FILE', '1') feeluown.__main__.main()