mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 19:13:25 -08:00
[CrashReporting] Give crash-report logging its own category per review
This commit is contained in:
parent
4d790ff388
commit
9ced9b61ef
3 changed files with 8 additions and 2 deletions
|
|
@ -6,10 +6,13 @@
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QLoggingCategory>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <libcockatrice/settings/personal_settings.h>
|
#include <libcockatrice/settings/personal_settings.h>
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(CrashReportLog, "crash_report");
|
||||||
|
|
||||||
bool CrashReporter::isReportingEnabled(const QString &dsn, PersonalSettings::CrashReportingMode consentMode)
|
bool CrashReporter::isReportingEnabled(const QString &dsn, PersonalSettings::CrashReportingMode consentMode)
|
||||||
{
|
{
|
||||||
return !dsn.isEmpty() && consentMode != PersonalSettings::CrashReportingMode::NeverSend;
|
return !dsn.isEmpty() && consentMode != PersonalSettings::CrashReportingMode::NeverSend;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#ifndef CRASH_REPORTER_H
|
#ifndef CRASH_REPORTER_H
|
||||||
#define CRASH_REPORTER_H
|
#define CRASH_REPORTER_H
|
||||||
|
|
||||||
|
#include <QLoggingCategory>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <libcockatrice/settings/personal_settings.h>
|
#include <libcockatrice/settings/personal_settings.h>
|
||||||
|
|
||||||
|
|
@ -17,6 +18,8 @@
|
||||||
#define COCKATRICE_SENTRY_DSN ""
|
#define COCKATRICE_SENTRY_DSN ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(CrashReportLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sentry-backed crash-report facade, owned by main().
|
* @brief Sentry-backed crash-report facade, owned by main().
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -136,9 +136,9 @@ void DlgCrashReport::actSend()
|
||||||
}
|
}
|
||||||
const QString savedPath = writeMockReport(previewArea->toPlainText());
|
const QString savedPath = writeMockReport(previewArea->toPlainText());
|
||||||
if (savedPath.isEmpty()) {
|
if (savedPath.isEmpty()) {
|
||||||
qWarning() << "Could not save the mock crash report locally";
|
qCWarning(CrashReportLog) << "Could not save the mock crash report locally";
|
||||||
} else {
|
} else {
|
||||||
qInfo() << "Mock crash report saved locally to" << savedPath;
|
qCInfo(CrashReportLog) << "Mock crash report saved locally to" << savedPath;
|
||||||
}
|
}
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue