Add current log file as file attachment to crash dump

ref T401
This commit is contained in:
Roland Rossgotterer
2019-02-15 09:09:56 +01:00
committed by Mat Sutcliffe
parent 4ca1f46f74
commit 50e82c26c6

View File

@@ -1667,6 +1667,13 @@ namespace BlackCore
annotations["format"] = "minidump";
annotations["version"] = CBuildConfig::getVersionString().toStdString();
QString logFilePath = m_fileLogger->getLogFilePath();
QString logFileName = m_fileLogger->getLogFileName();
QString logAttachment = QString("--attachment=%1=%2").arg(logFileName, logFilePath);
std::vector<std::string> arguments;
arguments.push_back(logAttachment.toStdString());
QDir().mkpath(database);
m_crashReportDatabase = CrashReportDatabase::Initialize(qstringToFilePath(database));
crashpad::Settings *settings = m_crashReportDatabase->GetSettings();
@@ -1677,7 +1684,7 @@ namespace BlackCore
qstringToFilePath(metrics),
serverUrl.getFullUrl().toStdString(),
annotations,
{},
arguments,
false, true);
return CStatusMessage(this).info(u"Using crash handler");
#else