diff --git a/src/dbus/qdbusxmlparser.cpp b/src/dbus/qdbusxmlparser.cpp index fa362bc579..3618c76a1d 100644 --- a/src/dbus/qdbusxmlparser.cpp +++ b/src/dbus/qdbusxmlparser.cpp @@ -48,15 +48,12 @@ #ifndef QT_NO_DBUS -//#define QDBUS_PARSER_DEBUG -#ifdef QDBUS_PARSER_DEBUG -# define qDBusParserError qDebug -#else -# define qDBusParserError if (true) {} else qDebug -#endif - QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(dbusParser, "dbus.parser", QtWarningMsg) + +#define qDBusParserError(...) qCDebug(dbusParser, ##__VA_ARGS__) + static bool parseArg(const QXmlStreamAttributes &attributes, QDBusIntrospection::Argument &argData, QDBusIntrospection::Interface *ifaceData) { diff --git a/src/dbus/qdbusxmlparser_p.h b/src/dbus/qdbusxmlparser_p.h index 7db2d12df4..d089bae163 100644 --- a/src/dbus/qdbusxmlparser_p.h +++ b/src/dbus/qdbusxmlparser_p.h @@ -52,6 +52,7 @@ // #include +#include #include #include "qdbusintrospection_p.h" @@ -59,6 +60,8 @@ QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(dbusParser) + /*! \internal */ diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index e58f194b72..8dbb1bf350 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -1092,6 +1093,9 @@ int main(int argc, char **argv) } } + if (verbose) + QLoggingCategory::setFilterRules(QStringLiteral("dbus.parser.debug=true")); + QDBusIntrospection::Interfaces interfaces = readInput(); cleanInterfaces(interfaces);