12#include <QCoreApplication>
13#include <QLoggingCategory>
15Q_DECLARE_LOGGING_CATEGORY(zero)
16Q_DECLARE_LOGGING_CATEGORY(one)
17Q_DECLARE_LOGGING_CATEGORY(two)
18Q_DECLARE_LOGGING_CATEGORY(three)
19Q_DECLARE_LOGGING_CATEGORY(four)
20Q_DECLARE_LOGGING_CATEGORY(five)
24#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0)
25#define qCDebug(category) \
26 for (bool qt_category_enabled = category().isDebugEnabled(); qt_category_enabled; qt_category_enabled = false) \
27 QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).debug().noquote().nospace()
29#define qCDebug(category) QT_MESSAGE_LOGGER_COMMON(category, QtDebugMsg).debug().noquote().nospace()
67 const char *
file =
nullptr,
int line = 0);
86 const char *
file()
const;
92 QString m_englishMessage;
93 const char *m_file =
nullptr;
98#define PANDACEPTION(msg, ...) \
99 Pandaception(tr(msg) __VA_OPT__(.arg(__VA_ARGS__)), QString(msg) __VA_OPT__(.arg(__VA_ARGS__)), __FILE__, __LINE__)
102#define PANDACEPTION_WITH_CONTEXT(context, msg, ...) \
103 Pandaception(QCoreApplication::translate(context, msg) __VA_OPT__(.arg(__VA_ARGS__)), QString(msg) __VA_OPT__(.arg(__VA_ARGS__)), __FILE__, __LINE__)
107#define PANDACEPTION_LITERAL(msg, ...) \
108 Pandaception(QStringLiteral(msg) __VA_OPT__(.arg(__VA_ARGS__)), QStringLiteral(msg) __VA_OPT__(.arg(__VA_ARGS__)), __FILE__, __LINE__)
QString englishMessage() const
Returns the English (non-translated) message for logging and crash reports.
const char * file() const
Returns the source file where the exception was thrown, or nullptr.
Pandaception(const QString &translatedMessage, const QString &englishMessage, const char *file=nullptr, int line=0)
Constructs the exception with throw-site location for Sentry.
int line() const
Returns the source line where the exception was thrown, or 0.