summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-06-21 12:49:44 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-06-23 13:27:39 (GMT)
commit7f0fe603be200c09c74cf9cc295a972f3c3dbdfd (patch)
tree6541fe19808b03a6f0d719e2a25cbf1cc1fa6a11 /Swift
parentfbc02ab3b96fb46231458d2e283cfdd191185fb5 (diff)
downloadswift-7f0fe603be200c09c74cf9cc295a972f3c3dbdfd.zip
swift-7f0fe603be200c09c74cf9cc295a972f3c3dbdfd.tar.bz2
Change minidump filename format to include version and date
The new format is VERSION_DATE_UUID.dmp. Included the diff for the Breakpad modification. Test-Information: Tested by adding crashing code and verified the filename of the created minidump file on Windows 8 with VS 2013. Change-Id: I963e7913fadf4787742439da590e12e121ef3435
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/main.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/Swift/QtUI/main.cpp b/Swift/QtUI/main.cpp
index dde1487..11f51f6 100644
--- a/Swift/QtUI/main.cpp
+++ b/Swift/QtUI/main.cpp
@@ -4,10 +4,13 @@
* See the COPYING file for more information.
*/
-#include <stdlib.h>
-
+#include <cstdlib>
#include <iostream>
+#include <locale>
+#include <memory>
+#include <sstream>
+#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/program_options.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/variables_map.hpp>
@@ -35,7 +38,15 @@
int main(int argc, char* argv[]) {
Swift::PlatformApplicationPathProvider applicationPathProvider(SWIFT_APPLICATION_NAME);
- Swift::CrashReporter crashReporter(applicationPathProvider.getDataDir() / "crashes");
+ // Set crash report prefix to include date and version.
+ std::stringstream prefix;
+ auto outputFacet = std::unique_ptr<boost::gregorian::date_facet>(new boost::gregorian::date_facet());
+ outputFacet->format("%Y-%m-%d");
+ prefix.imbue(std::locale(std::locale::classic(), outputFacet.get()));
+
+ prefix << buildVersion << "_" << boost::gregorian::date(boost::gregorian::day_clock::local_day()) << "_";
+
+ Swift::CrashReporter crashReporter(applicationPathProvider.getDataDir() / "crashes", prefix.str());
#if QT_VERSION < 0x050000
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));