Logging
Unsolved
Qt for Python
-
Hi,
I am playing around with logging in PySide6 and found some (for me weird) issues.
qInfo
is not implemented?- calling
qFatal
2.1) passesQtWarningMessage
as type to the message handler, prints correct msg
2.2) calls message handler again withQtFatalMessage
and correct msg
2.3) butqFormatLogMessage
then returns
[A qFatal() call was made from Python code]
my code:
LogMessagePattern = ("%{time yyyy-MM-dd HH:mm:ss.zzz} [%{type}]" + "%{if-debug} %{appname}.%{function}%{endif}" + "%{if-warning}\033[93m %{endif}" + "%{if-critical}\033[33m %{endif}" + "%{if-fatal}\033[91m %{endif}" + " : %{message}" + "\033[39m")
#qInfo() qWarning("Warnung") qCritical("Kritisch") qFatal("Fatal")
what I get:
2024-11-18 14:49:19.483 [warning] : Warnung 2024-11-18 14:49:19.483 [critical] : Kritisch 2024-11-18 14:49:19.483 [warning] : Fatal 2024-11-18 14:49:19.483 [fatal] : [A qFatal() call was made from Python code]
This might be a bug?
and finally
- What does the
qCWarning
,qCDebug
, ... do? The first parameter is an object. What object? I could not find a suitable documentation.
Joachim
-
What does the qCWarning, qCDebug, ... do? The first parameter is an object. What object? I could not find a suitable documentation.
This is for categorized logging, more info here: https://doc.qt.io/qt-6/qloggingcategory.html. I don't know if it works with Python.