5#include <QtCore/QLoggingCategory>
6#include <QtCore/QObject>
7#include <QtCore/QStringList>
14#define QGC_LOGGING_CATEGORY(name, categoryStr) \
15 static QGCLoggingCategory qgcCategory ## name (categoryStr); \
16 Q_LOGGING_CATEGORY(name, categoryStr, QtWarningMsg)
18#define QGC_LOGGING_CATEGORY_ON(name, categoryStr) \
19 static QGCLoggingCategory qgcCategory ## name (categoryStr); \
20 Q_LOGGING_CATEGORY(name, categoryStr, QtInfoMsg)
52 static void _splitFullCategoryName(
const QString &fullCategoryName, QString &parentCategory, QString &childCategory);
59 static constexpr const char *kFilterRulesSettingsGroup =
"LoggingFilters";
74 Q_PROPERTY(QString shortCategory MEMBER shortCategory CONSTANT)
75 Q_PROPERTY(QString fullCategory MEMBER fullCategory CONSTANT)
76 Q_PROPERTY(
bool enabled READ enabled WRITE setEnabled NOTIFY
enabledChanged)
81 QGCLoggingCategoryItem(
const QString& shortCategory_,
const QString& fullCategory_,
bool enabled_, QObject* parent =
nullptr);
83 bool enabled()
const {
return _enabled; }
84 void setEnabled(
bool enabled);
86 QString shortCategory;
88 bool _enabled =
false;
89 bool expanded =
false;
void registerCategory(const QString &category)
Registers the specified logging category to the system.
static bool categoryLoggingOn(const QString &fullCategroryName)
Returns true if logging is turned on for the specified category.
QmlObjectListModel * treeCategoryModel()
Returns the hierarchical list of available logging category names.
static QGCLoggingCategoryManager * instance()
QmlObjectListModel * flatCategoryModel()
Returns the flat list of available logging category names.
void setCategoryLoggingOn(const QString &fullCategoryName, bool enable)
Turns on/off logging for the specified category. State is saved in app settings.
void disableAllCategories()
void setFilterRulesFromSettings(const QString &commandLineLoggingOptions)
QGCLoggingCategory(const QString &category)