core/log: add read-log --filter

This commit is contained in:
outfoxxed 2024-08-09 23:45:46 -07:00
parent 0fc98652a8
commit c2b4610acb
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 232 additions and 19 deletions

View file

@ -33,6 +33,7 @@ struct LogMessage {
QDateTime time;
QLatin1StringView category;
QByteArray body;
quint16 readCategoryId = 0;
static void formatMessage(QTextStream& stream, const LogMessage& msg, bool color, bool timestamp);
};
@ -63,6 +64,8 @@ struct CategoryFilter {
, warn(category->isWarningEnabled())
, critical(category->isCriticalEnabled()) {}
[[nodiscard]] bool shouldDisplay(QtMsgType type) const;
bool debug = true;
bool info = true;
bool warn = true;
@ -95,7 +98,7 @@ private:
LoggingThreadProxy threadProxy;
};
bool readEncodedLogs(QIODevice* device);
bool readEncodedLogs(QIODevice* device, const QString& rulespec);
} // namespace qs::log