From 9ced9b61ef1b24e390c98a18545d1ae320ab99e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sun, 18 Oct 2026 13:10:37 +0200 Subject: [PATCH] [CrashReporting] Give crash-report logging its own category per review --- cockatrice/src/client/crash/crash_reporter.cpp | 3 +++ cockatrice/src/client/crash/crash_reporter.h | 3 +++ cockatrice/src/interface/widgets/dialogs/dlg_crash_report.cpp | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/client/crash/crash_reporter.cpp b/cockatrice/src/client/crash/crash_reporter.cpp index 41a6f2726..fe1678b11 100644 --- a/cockatrice/src/client/crash/crash_reporter.cpp +++ b/cockatrice/src/client/crash/crash_reporter.cpp @@ -6,10 +6,13 @@ #include #include +#include #include #include #include +Q_LOGGING_CATEGORY(CrashReportLog, "crash_report"); + bool CrashReporter::isReportingEnabled(const QString &dsn, PersonalSettings::CrashReportingMode consentMode) { return !dsn.isEmpty() && consentMode != PersonalSettings::CrashReportingMode::NeverSend; diff --git a/cockatrice/src/client/crash/crash_reporter.h b/cockatrice/src/client/crash/crash_reporter.h index b32a41e27..f57ec6019 100644 --- a/cockatrice/src/client/crash/crash_reporter.h +++ b/cockatrice/src/client/crash/crash_reporter.h @@ -6,6 +6,7 @@ #ifndef CRASH_REPORTER_H #define CRASH_REPORTER_H +#include #include #include @@ -17,6 +18,8 @@ #define COCKATRICE_SENTRY_DSN "" #endif +Q_DECLARE_LOGGING_CATEGORY(CrashReportLog); + /** * @brief Sentry-backed crash-report facade, owned by main(). * diff --git a/cockatrice/src/interface/widgets/dialogs/dlg_crash_report.cpp b/cockatrice/src/interface/widgets/dialogs/dlg_crash_report.cpp index 4061c864f..7fc69e12b 100644 --- a/cockatrice/src/interface/widgets/dialogs/dlg_crash_report.cpp +++ b/cockatrice/src/interface/widgets/dialogs/dlg_crash_report.cpp @@ -136,9 +136,9 @@ void DlgCrashReport::actSend() } const QString savedPath = writeMockReport(previewArea->toPlainText()); if (savedPath.isEmpty()) { - qWarning() << "Could not save the mock crash report locally"; + qCWarning(CrashReportLog) << "Could not save the mock crash report locally"; } else { - qInfo() << "Mock crash report saved locally to" << savedPath; + qCInfo(CrashReportLog) << "Mock crash report saved locally to" << savedPath; } accept(); }