aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/sentryintegration.h
blob: f25cf5dcecb4b7b851b12b72aad99a869a75f909 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include <zencore/intmath.h>
#include <zencore/zencore.h>

#if !defined(ZEN_USE_SENTRY)
#	if ZEN_PLATFORM_MAC && ZEN_ARCH_ARM64
// vcpkg's sentry-native port does not support Arm on Mac.
#		define ZEN_USE_SENTRY 0
#	else
#		define ZEN_USE_SENTRY 1
#	endif
#endif

#if ZEN_USE_SENTRY

#	include <memory>

namespace sentry {

struct SentryAssertImpl;

}  // namespace sentry

namespace zen {

class SentryIntegration
{
public:
	SentryIntegration();
	~SentryIntegration();

	void		Initialize(std::string SentryDatabasePath, std::string SentryAttachmentsPath, bool AllowPII);
	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;
};

}  // namespace zen
#endif