-
-
Notifications
You must be signed in to change notification settings - Fork 48
Switch the existing Sentry classes to use USTRUCTs #854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,60 +5,90 @@ | |
#include "SentryDataTypes.h" | ||
#include "SentryImplWrapper.h" | ||
|
||
#include "Kismet/BlueprintFunctionLibrary.h" | ||
|
||
#include "SentryBreadcrumb.generated.h" | ||
|
||
class ISentryBreadcrumb; | ||
|
||
/** | ||
* Information to create a trail of events that happened prior to an issue. | ||
*/ | ||
UCLASS(BlueprintType, NotBlueprintable, HideDropdown) | ||
class SENTRY_API USentryBreadcrumb : public UObject, public TSentryImplWrapper<ISentryBreadcrumb, USentryBreadcrumb> | ||
USTRUCT(BlueprintType) | ||
struct SENTRY_API FSentryBreadcrumb | ||
{ | ||
GENERATED_BODY() | ||
|
||
public: | ||
/** Initializes the breadcrumb. */ | ||
UFUNCTION(BlueprintCallable, Category = "Sentry") | ||
void Initialize(); | ||
FSentryBreadcrumb(); | ||
|
||
void SetMessage(const FString& Message); | ||
FString GetMessage() const; | ||
|
||
void SetType(const FString& Type); | ||
FString GetType() const; | ||
|
||
void SetCategory(const FString& Category); | ||
FString GetCategory() const; | ||
|
||
void SetData(const TMap<FString, FString>& Data); | ||
TMap<FString, FString> GetData() const; | ||
|
||
void SetLevel(ESentryLevel Level); | ||
ESentryLevel GetLevel() const; | ||
|
||
/** Retrieves the underlying native implementation. */ | ||
TSharedPtr<ISentryBreadcrumb> GetNativeObject() const { return NativeImpl; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general, it seems odd that we ever expose this. Perhaps we can remove the need for this and any public callers can use a different method? For example, we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good point. There are definitely a few use cases where we can remove |
||
|
||
private: | ||
TSharedPtr<ISentryBreadcrumb> NativeImpl; | ||
}; | ||
|
||
/** | ||
* Utility blueprint functions for Sentry breadcrumb. | ||
*/ | ||
UCLASS() | ||
class SENTRY_API USentryBreadcrumbLibrary : public UBlueprintFunctionLibrary | ||
{ | ||
GENERATED_BODY() | ||
|
||
public: | ||
/** Sets message of the breadcrumb. */ | ||
UFUNCTION(BlueprintCallable, Category = "Sentry") | ||
void SetMessage(const FString& Message); | ||
static void SetMessage(UPARAM(ref) FSentryBreadcrumb& Breadcrumb, const FString& Message); | ||
|
||
/** Gets message of the breadcrumb. */ | ||
UFUNCTION(BlueprintPure, Category = "Sentry") | ||
FString GetMessage() const; | ||
static FString GetMessage(const FSentryBreadcrumb& Breadcrumb); | ||
|
||
/** Sets type of the breadcrumb. */ | ||
UFUNCTION(BlueprintCallable, Category = "Sentry") | ||
void SetType(const FString& Type); | ||
static void SetType(UPARAM(ref) FSentryBreadcrumb& Breadcrumb, const FString& Type); | ||
|
||
/** Gets type of the breadcrumb. */ | ||
UFUNCTION(BlueprintPure, Category = "Sentry") | ||
FString GetType() const; | ||
static FString GetType(const FSentryBreadcrumb& Breadcrumb); | ||
|
||
/** Sets category of the breadcrumb. */ | ||
UFUNCTION(BlueprintCallable, Category = "Sentry") | ||
void SetCategory(const FString& Category); | ||
static void SetCategory(UPARAM(ref) FSentryBreadcrumb& Breadcrumb, const FString& Category); | ||
|
||
/** Gets category of the breadcrumb. */ | ||
UFUNCTION(BlueprintPure, Category = "Sentry") | ||
FString GetCategory() const; | ||
static FString GetCategory(const FSentryBreadcrumb& Breadcrumb); | ||
|
||
/** Sets data associated with the breadcrumb. */ | ||
UFUNCTION(BlueprintCallable, Category = "Sentry") | ||
void SetData(const TMap<FString, FString>& Data); | ||
static void SetData(UPARAM(ref) FSentryBreadcrumb& Breadcrumb, const TMap<FString, FString>& Data); | ||
|
||
/** Gets data associated with the breadcrumb. */ | ||
UFUNCTION(BlueprintPure, Category = "Sentry") | ||
TMap<FString, FString> GetData() const; | ||
static TMap<FString, FString> GetData(const FSentryBreadcrumb& Breadcrumb); | ||
|
||
/** Sets the level of the breadcrumb. */ | ||
UFUNCTION(BlueprintCallable, Category = "Sentry") | ||
void SetLevel(ESentryLevel Level); | ||
static void SetLevel(UPARAM(ref) FSentryBreadcrumb& Breadcrumb, ESentryLevel Level); | ||
|
||
/** Gets the level of the breadcrumb. */ | ||
UFUNCTION(BlueprintPure, Category = "Sentry") | ||
ESentryLevel GetLevel() const; | ||
static ESentryLevel GetLevel(const FSentryBreadcrumb& Breadcrumb); | ||
}; |
Uh oh!
There was an error while loading. Please reload this page.