summaryrefslogtreecommitdiff
path: root/qutebrowser/misc/earlyinit.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-07-21 14:52:24 +0200
committerGitHub <noreply@github.com>2023-07-21 14:52:24 +0200
commit1387b0598b90501dfa1dc8e4cbe5e1d0d05cd048 (patch)
treec10b53a21a316dee9d2b42af3ea737df29df2339 /qutebrowser/misc/earlyinit.py
parent059a280e4ec11898148df78578b7a29cc2bd41d3 (diff)
parent01ab247a410488f86ac57cf07e22cca5e62bc92c (diff)
downloadqutebrowser-1387b0598b90501dfa1dc8e4cbe5e1d0d05cd048.tar.gz
qutebrowser-1387b0598b90501dfa1dc8e4cbe5e1d0d05cd048.zip
Merge pull request #7772 from pylbrecht/logfilter
Don't crash on --logfilter at startup
Diffstat (limited to 'qutebrowser/misc/earlyinit.py')
-rw-r--r--qutebrowser/misc/earlyinit.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py
index a0265d653..57e821784 100644
--- a/qutebrowser/misc/earlyinit.py
+++ b/qutebrowser/misc/earlyinit.py
@@ -298,7 +298,17 @@ def init_log(args):
from qutebrowser.utils import log
log.init_log(args)
log.init.debug("Log initialized.")
- log.init.debug(str(machinery.INFO))
+
+
+def init_qtlog(args):
+ """Initialize Qt logging.
+
+ Args:
+ args: The argparse namespace.
+ """
+ from qutebrowser.utils import log, qtlog
+ qtlog.init(args)
+ log.init.debug("Qt log initialized.")
def check_optimize_flag():
@@ -333,16 +343,18 @@ def early_init(args):
Args:
args: The argparse namespace.
"""
+ # Init logging as early as possible
+ init_log(args)
# First we initialize the faulthandler as early as possible, so we
# theoretically could catch segfaults occurring later during earlyinit.
init_faulthandler()
# Then we configure the selected Qt wrapper
info = machinery.init(args)
+ # Init Qt logging after machinery is initialized
+ init_qtlog(args)
# Here we check if QtCore is available, and if not, print a message to the
# console or via Tk.
check_qt_available(info)
- # Init logging as early as possible
- init_log(args)
# Now we can be sure QtCore is available, so we can print dialogs on
# errors, so people only using the GUI notice them as well.
check_libraries()