aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-05-06 16:50:57 +0200
committerGitHub Enterprise <[email protected]>2025-05-06 16:50:57 +0200
commit6d9ff7e404a22ed1cc7e529cfa77ef7d593d9547 (patch)
tree5cfea359c44b02fe72ab5b166e9b03900444fcba /src/zencore/include
parentcleanup changelog (diff)
downloadzen-6d9ff7e404a22ed1cc7e529cfa77ef7d593d9547.tar.xz
zen-6d9ff7e404a22ed1cc7e529cfa77ef7d593d9547.zip
add sentry for zen command (#373)
* refactor sentry integration and add to zen command line tool * move add_ldflags("-framework Security")
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/sentryintegration.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/sentryintegration.h b/src/zencore/include/zencore/sentryintegration.h
new file mode 100644
index 000000000..40e22af4e
--- /dev/null
+++ b/src/zencore/include/zencore/sentryintegration.h
@@ -0,0 +1,50 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#pragma once
+
+#include <zencore/intmath.h>
+#include <zencore/zencore.h>
+
+#if !defined(ZEN_USE_SENTRY)
+# define ZEN_USE_SENTRY 1
+#endif
+
+#if ZEN_USE_SENTRY
+
+# include <memory>
+
+ZEN_THIRD_PARTY_INCLUDES_START
+# include <spdlog/logger.h>
+ZEN_THIRD_PARTY_INCLUDES_END
+
+namespace sentry {
+
+struct SentryAssertImpl;
+
+} // namespace sentry
+
+namespace zen {
+
+class SentryIntegration
+{
+public:
+ SentryIntegration();
+ ~SentryIntegration();
+
+ void Initialize(std::string SentryDatabasePath, std::string SentryAttachmentsPath, bool AllowPII, const std::string& CommandLine);
+ void LogStartupInformation();
+ static void ClearCaches();
+
+private:
+ int m_SentryErrorCode = 0;
+ bool m_IsInitialized = false;
+ bool m_AllowPII = false;
+ std::unique_ptr<sentry::SentryAssertImpl> m_SentryAssert;
+ std::string m_SentryUserName;
+ std::string m_SentryHostName;
+ std::string m_SentryId;
+ std::shared_ptr<spdlog::logger> m_SentryLogger;
+};
+
+} // namespace zen
+#endif