We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b6d309 commit c7ad329Copy full SHA for c7ad329
src/gui/main.py
@@ -6,6 +6,7 @@
6
"""
7
8
import sys
9
+import logging
10
import webbrowser
11
12
from PyQt5 import QtWidgets, QtCore, QtGui
@@ -20,6 +21,18 @@
20
21
from src.convert import convert_dir_text
22
from src.pdf.bookmark import add_bookmark
23
24
+logging.basicConfig(level=logging.DEBUG,
25
+ format='%(asctime)s - %(levelname)s - %(message)s',
26
+ filename='pdfdir.log',
27
+ filemode='a')
28
+
29
30
+def log_uncaught_exceptions(ex_cls, ex, tb):
31
+ text = '{}: {}:\n'.format(ex_cls.__name__, ex)
32
+ logging.critical(text, exc_info=(ex_cls, ex, tb))
33
34
35
+sys.excepthook = log_uncaught_exceptions
36
37
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
38
0 commit comments