Logging filter for QRemoteObjects
-
I would like to suppress the following log message:
"Dynamic metaobject is not assigned"
However, using QLoggingCategory.setFilterRules("") I can't seem to find a way to disable it.
It almost looks like an uncategorized log. I can stop it by adding QLoggingCategory.setFilterRules("*")
Any advice would be appreciated
-
I would like to suppress the following log message:
"Dynamic metaobject is not assigned"
However, using QLoggingCategory.setFilterRules("") I can't seem to find a way to disable it.
It almost looks like an uncategorized log. I can stop it by adding QLoggingCategory.setFilterRules("*")
Any advice would be appreciated
I had a look in the source code, this is what it does:
if (!impl->m_metaObject) { qWarning() << "Dynamic metaobject is not assigned, returning generic Replica metaObject."; qWarning() << "This may cause issues if used for more than checking the Replica state."; return QRemoteObjectReplica::metaObject(); }Since this is a generic warning, the way to suppress is:
QLoggingCategory.setFilterRules("*.warning=false")Not the greatest I guess, since it may suppress other warnings. But in PySide, the object definitions are not compiled (and I don't believe there is a way to do it), so you always get this warning.
-
I had a look in the source code, this is what it does:
if (!impl->m_metaObject) { qWarning() << "Dynamic metaobject is not assigned, returning generic Replica metaObject."; qWarning() << "This may cause issues if used for more than checking the Replica state."; return QRemoteObjectReplica::metaObject(); }Since this is a generic warning, the way to suppress is:
QLoggingCategory.setFilterRules("*.warning=false")Not the greatest I guess, since it may suppress other warnings. But in PySide, the object definitions are not compiled (and I don't believe there is a way to do it), so you always get this warning.
@dodgyrabbit
Yes, suppressing all warning messages for the sake of one particular one is not nice.Forget about
QLoggingCategory, it's too "coarse". You need something where you can see the message text. All Qt messages, includingqWarning()etc., send their messages for output via QtMessageHandler qInstallMessageHandler(QtMessageHandler handler) which you can intercept. Install your own handler as shown. Calling that returns a pointer to the previous message handler. Discard your undesired message by looking atconst QString &msg, call the previous handler for anything else.