summaryrefslogtreecommitdiff
path: root/include/desktop
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-11-25 16:50:22 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-02-25 00:50:08 +0000
commit98a8eafa915b8d57b8bdccab9981e537d77f6f4a (patch)
treec0d7dea9b32eaad23762e9c238614af54ac5211c /include/desktop
parentaaca25d67eb5ea252730cdcf555ecc04ce04a5e6 (diff)
add way to add additional information to the crash report
We can add several additional key value pairs during the execution of the program that will be used on the server to show more information. Change-Id: I4102adc15fc821415fa0b997ca7fe0dc4f7abcec Reviewed-on: https://gerrit.libreoffice.org/22553 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'include/desktop')
-rw-r--r--include/desktop/crashreport.hxx57
-rw-r--r--include/desktop/dllapi.h24
2 files changed, 81 insertions, 0 deletions
diff --git a/include/desktop/crashreport.hxx b/include/desktop/crashreport.hxx
new file mode 100644
index 000000000000..ace76c772816
--- /dev/null
+++ b/include/desktop/crashreport.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_DESKTOP_CRASHREPORT_HXX
+#define INCLUDED_DESKTOP_CRASHREPORT_HXX
+
+#include <desktop/dllapi.h>
+
+#include <rtl/ustring.hxx>
+#include <osl/mutex.hxx>
+
+#include <config_features.h>
+
+#include <map>
+
+/**
+ * Provides access to the crash reporter service.
+ *
+ * Valid keys are:
+ * * AdapterVendorId
+ * * AdapterDeviceId
+ *
+ */
+class DESKTOP_DLLPUBLIC CrashReporter
+{
+public:
+ static void AddKeyValue(const OUString& rKey, const OUString& rValue);
+
+ const char* getIniFileName();
+
+private:
+
+ static std::map<OUString, OUString> maValueMap;
+
+ static osl::Mutex maMutex;
+};
+
+// Add dummy methods for the non-breakpad case. That allows us to use
+// the code without linking to the lib and without adding HAVE_FEATURE_BREAKPAD
+// everywhere we want to log something to the crash report system.
+#if HAVE_FEATURE_BREAKPAD
+#else
+void CrashReporter::AddKeyValue(const OUString& /*rKey*/, const OUString& /*rValue*/)
+{
+}
+#endif
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/desktop/dllapi.h b/include/desktop/dllapi.h
new file mode 100644
index 000000000000..ebc75f1214ac
--- /dev/null
+++ b/include/desktop/dllapi.h
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_DESKTOP_SOURCE_INC_DESKTOPDLLAPI_H
+#define INCLUDED_DESKTOP_SOURCE_INC_DESKTOPDLLAPI_H
+
+#include <sal/config.h>
+#include <sal/types.h>
+
+#if defined(DESKTOP_DLLIMPLEMENTATION)
+# define DESKTOP_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+# define DESKTOP_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim: set shiftwidth=4 softtabstop=4 expandtab: */