Fix verbose logging change needed full restart

This commit is contained in:
Flowseal
2026-11-18 00:23:20 +03:00
parent c053b40014
commit 9f71904e1a
4 changed files with 14 additions and 8 deletions
+3 -3
View File
@@ -9,8 +9,8 @@ from typing import Union
from proxy import coerce_domain_list, parse_dc_ip_list
from ui.i18n import t
UI_ONLY_KEYS = frozenset({
"appearance", "autostart", "check_updates", "language"
LIVE_SETTINGS_KEYS = frozenset({
"appearance", "autostart", "check_updates", "language", "verbose"
})
@@ -21,7 +21,7 @@ class SettingsChange:
@property
def requires_restart(self) -> bool:
return bool(self.changed_keys - UI_ONLY_KEYS)
return bool(self.changed_keys - LIVE_SETTINGS_KEYS)
def prepare_settings(current: dict, values: dict, defaults: dict) -> SettingsChange:
+3
View File
@@ -9,6 +9,7 @@ from tkinter import messagebox
from ui.settings_form import validate_config_form
from ui.i18n import set_language, t
from ui.settings import prepare_settings
from utils.logging_setup import set_verbose_logging
log = logging.getLogger("tg-ws-tray")
@@ -71,6 +72,8 @@ class SettingsDialog:
messagebox.showerror(t("app.error_title"), str(exc), parent=self.root)
return
self.config.update(deepcopy(change.config))
if "verbose" in change.changed_keys:
set_verbose_logging(change.config["verbose"])
set_language(change.config["language"])
changed_keys = change.changed_keys | ({"autostart"} if autostart_changed else set())
log.info("Settings saved: %s", ", ".join(sorted(changed_keys)))