-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathSentrySubsystemDesktop.h
72 lines (54 loc) · 3.04 KB
/
SentrySubsystemDesktop.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright (c) 2022 Sentry. All Rights Reserved.
#pragma once
#include "HAL/CriticalSection.h"
#include "Interface/SentrySubsystemInterface.h"
class SentryScopeDesktop;
class SentryCrashReporter;
#if USE_SENTRY_NATIVE
class SentrySubsystemDesktop : public ISentrySubsystem
{
public:
SentrySubsystemDesktop();
virtual void InitWithSettings(const USentrySettings* settings, USentryBeforeSendHandler* beforeSendHandler, USentryTraceSampler* traceSampler) override;
virtual void Close() override;
virtual bool IsEnabled() override;
virtual ESentryCrashedLastRun IsCrashedLastRun() override;
virtual void AddBreadcrumb(USentryBreadcrumb* breadcrumb) override;
virtual void AddBreadcrumbWithParams(const FString& Message, const FString& Category, const FString& Type, const TMap<FString, FString>& Data, ESentryLevel Level) override;
virtual void ClearBreadcrumbs() override;
virtual USentryId* CaptureMessage(const FString& message, ESentryLevel level) override;
virtual USentryId* CaptureMessageWithScope(const FString& message, const FConfigureScopeNativeDelegate& onScopeConfigure, ESentryLevel level) override;
virtual USentryId* CaptureEvent(USentryEvent* event) override;
virtual USentryId* CaptureEventWithScope(USentryEvent* event, const FConfigureScopeNativeDelegate& onScopeConfigure) override;
virtual USentryId* CaptureException(const FString& type, const FString& message, int32 framesToSkip) override;
virtual USentryId* CaptureAssertion(const FString& type, const FString& message) override;
virtual USentryId* CaptureEnsure(const FString& type, const FString& message) override;
virtual void CaptureUserFeedback(USentryUserFeedback* userFeedback) override;
virtual void SetUser(USentryUser* user) override;
virtual void RemoveUser() override;
virtual void ConfigureScope(const FConfigureScopeNativeDelegate& onConfigureScope) override;
virtual void SetContext(const FString& key, const TMap<FString, FString>& values) override;
virtual void SetTag(const FString& key, const FString& value) override;
virtual void RemoveTag(const FString& key) override;
virtual void SetLevel(ESentryLevel level) override;
virtual void StartSession() override;
virtual void EndSession() override;
virtual USentryTransaction* StartTransaction(const FString& name, const FString& operation) override;
virtual USentryTransaction* StartTransactionWithContext(USentryTransactionContext* context) override;
virtual USentryTransaction* StartTransactionWithContextAndOptions(USentryTransactionContext* context, const TMap<FString, FString>& options) override;
USentryBeforeSendHandler* GetBeforeSendHandler();
void TryCaptureScreenshot() const;
TSharedPtr<SentryScopeDesktop> GetCurrentScope();
private:
FString GetHandlerPath() const;
FString GetDatabasePath() const;
FString GetScreenshotPath() const;
USentryBeforeSendHandler* beforeSend;
TSharedPtr<SentryCrashReporter> crashReporter;
TArray<TSharedPtr<SentryScopeDesktop>> scopeStack;
bool isEnabled;
bool isStackTraceEnabled;
bool isScreenshotAttachmentEnabled;
FCriticalSection CriticalSection;
};
#endif