Warning, file /utilities/kdebugsettings/src/loggingcategory.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2016-2023 Laurent Montel <montel@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 
0006 */
0007 #pragma once
0008 
0009 #include "libkdebugsettings_export.h"
0010 #include <QDebug>
0011 #include <QString>
0012 #include <QVector>
0013 
0014 struct LIBKDEBUGSETTINGS_EXPORT LoggingCategory {
0015     enum LoggingType { All = 0, Info, Warning, Debug, Critical, Off, Undefined };
0016 
0017     LoggingCategory();
0018     explicit LoggingCategory(const QString &description, const QString &logName, LoggingType loggingType, const QString &identifier, bool enabled)
0019         : description(description)
0020         , categoryName(logName)
0021         , identifierName(identifier)
0022         , loggingType(loggingType)
0023         , enabled(enabled)
0024     {
0025     }
0026 
0027     using List = QVector<LoggingCategory>;
0028     Q_REQUIRED_RESULT bool operator==(const LoggingCategory &other) const;
0029     Q_REQUIRED_RESULT bool isValid() const;
0030 
0031     Q_REQUIRED_RESULT QString createRule() const;
0032     Q_REQUIRED_RESULT QString createCustomRule() const;
0033 
0034     QString description;
0035     QString categoryName;
0036     QString identifierName;
0037     LoggingType loggingType = Info;
0038     LoggingType defaultSeverityType = Info;
0039     bool enabled = true;
0040 };
0041 LIBKDEBUGSETTINGS_EXPORT QDebug operator<<(QDebug debug, const LoggingCategory &cat);
0042 
0043 Q_DECLARE_TYPEINFO(LoggingCategory, Q_MOVABLE_TYPE);
0044 Q_DECLARE_METATYPE(LoggingCategory)
0045 Q_DECLARE_METATYPE(LoggingCategory::LoggingType)