From 014bd74d4d72e95cf0b29af4f1506dfa4b700f64 Mon Sep 17 00:00:00 2001 From: Faraphel Date: Wed, 17 Aug 2022 21:41:15 +0200 Subject: [PATCH] error log now contains the installer version --- source/gui/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/gui/__init__.py b/source/gui/__init__.py index 60425ca..a8f6691 100644 --- a/source/gui/__init__.py +++ b/source/gui/__init__.py @@ -3,6 +3,7 @@ from pathlib import Path from tkinter import messagebox from typing import Callable from source.translation import translate as _ +from source import __version__ import time @@ -16,7 +17,14 @@ def better_gui_error(func: Callable) -> Callable: except Exception: exc = traceback.format_exc() with Path("error.log").open("a", encoding="utf8") as log_file: - log_file.write(f"{'#' * 20}\n{time.strftime('%Y/%M/%d %H:%m:%S')}\n\n{exc}\n\n") + log_file.write( + f"{'#' * 20}\n" + f"{time.strftime('%Y/%M/%d %H:%m:%S')}\n" + f"Version: {__version__}\n" + f"\n" + f"{exc}\n" + f"\n" + ) messagebox.showerror(_("Error"), exc) return wrapper