diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index 02b70af1f..42e02e1c2 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -671,11 +671,6 @@ def _run(argv: Optional[list[str]] = None, exec: bool = True) -> Optional[AnkiAp # we've signaled the primary instance, so we should close return None - setup_logging( - pm.addon_logs(), - level=logging.DEBUG if int(os.getenv("ANKIDEV", "0")) else logging.INFO, - ) - if not pm: if i18n_setup: QMessageBox.critical( @@ -687,6 +682,11 @@ def _run(argv: Optional[list[str]] = None, exec: bool = True) -> Optional[AnkiAp QMessageBox.critical(None, "Startup Failed", "Unable to create data folder") return None + setup_logging( + pm.addon_logs(), + level=logging.DEBUG if int(os.getenv("ANKIDEV", "0")) else logging.INFO, + ) + # disable icons on mac; this must be done before window created if is_mac: app.setAttribute(Qt.ApplicationAttribute.AA_DontShowIconsInMenus)