Enhance logging capabilities for wizard classes

* Added QDebug operator<< for the Field classes so that they could be inspected during runtime (i.e. logged)
* Added optional QDebug operator<< overloads for QVariant (wizarddebug.h) - to better visualize the data parsed from the wizard.json files (QVariant objects), by using a format more in the like of json.

Change-Id: I53a729b24e4f2d9c9acf1ed802ac9dc3bb67f373
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Samuel Ghinet
2021-09-02 14:35:41 +03:00
parent 78372726c1
commit 8bd1969e7f
13 changed files with 373 additions and 31 deletions

View File

@@ -64,6 +64,21 @@ public:
GeneratedFile::Attributes attributes;
};
inline QDebug &operator<<(QDebug &debug, const Core::GeneratedFilePrivate &file)
{
debug << "path: " << file.path
<< "; editorId: " << file.editorId.toString()
<< "; binary: " << file.binary
<< "; contents: " << file.contents.size();
return debug;
}
QDebug &operator<<(QDebug &debug, const Core::GeneratedFile &file)
{
debug << "GeneratedFile{_: " << *file.m_d << "}";
return debug;
}
GeneratedFilePrivate::GeneratedFilePrivate(const QString &path) : // FIXME Don't use - Remove when possible
path(FilePath::fromString(path).cleanPath()),
attributes({})