-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/user-feedback
- Loading branch information
Showing
10 changed files
with
157 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (c) 2024 Sentry. All Rights Reserved. | ||
|
||
#include "SentryOutputDevice.h" | ||
|
||
#include "SentryBreadcrumb.h" | ||
#include "SentryModule.h" | ||
#include "SentrySettings.h" | ||
#include "SentrySubsystem.h" | ||
|
||
#include "Engine/Engine.h" | ||
|
||
void FSentryOutputDevice::Serialize(const TCHAR* V, ELogVerbosity::Type Verbosity, const FName& Category) | ||
{ | ||
const USentrySettings* Settings = FSentryModule::Get().GetSettings(); | ||
|
||
bool bAddBreadcrumb; | ||
|
||
ESentryLevel BreadcrumbLevel = ESentryLevel::Debug; | ||
|
||
switch (Verbosity) | ||
{ | ||
case ELogVerbosity::Fatal: | ||
bAddBreadcrumb = Settings->AutomaticBreadcrumbsForLogs.bOnFatalLog; | ||
BreadcrumbLevel = ESentryLevel::Fatal; | ||
break; | ||
case ELogVerbosity::Error: | ||
bAddBreadcrumb = Settings->AutomaticBreadcrumbsForLogs.bOnErrorLog; | ||
BreadcrumbLevel = ESentryLevel::Error; | ||
break; | ||
case ELogVerbosity::Warning: | ||
bAddBreadcrumb = Settings->AutomaticBreadcrumbsForLogs.bOnWarningLog; | ||
BreadcrumbLevel = ESentryLevel::Warning; | ||
break; | ||
case ELogVerbosity::Display: | ||
case ELogVerbosity::Log: | ||
bAddBreadcrumb = Settings->AutomaticBreadcrumbsForLogs.bOnInfoLog; | ||
BreadcrumbLevel = ESentryLevel::Info; | ||
break; | ||
case ELogVerbosity::Verbose: | ||
case ELogVerbosity::VeryVerbose: | ||
bAddBreadcrumb = Settings->AutomaticBreadcrumbsForLogs.bOnDebugLog; | ||
BreadcrumbLevel = ESentryLevel::Debug; | ||
break; | ||
default: | ||
bAddBreadcrumb = false; | ||
} | ||
|
||
if(!bAddBreadcrumb) | ||
{ | ||
return; | ||
} | ||
|
||
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>(); | ||
if(!SentrySubsystem || !SentrySubsystem->IsEnabled()) | ||
{ | ||
return; | ||
} | ||
|
||
SentrySubsystem->AddBreadcrumbWithParams(V, Category.ToString(), FString(), TMap<FString, FString>(), BreadcrumbLevel); | ||
} | ||
|
||
bool FSentryOutputDevice::CanBeUsedOnAnyThread() const | ||
{ | ||
return true; | ||
} | ||
|
||
bool FSentryOutputDevice::CanBeUsedOnMultipleThreads() const | ||
{ | ||
return true; | ||
} | ||
|
||
bool FSentryOutputDevice::CanBeUsedOnPanicThread() const | ||
{ | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2024 Sentry. All Rights Reserved. | ||
|
||
#pragma once | ||
|
||
#include "Misc/OutputDevice.h" | ||
|
||
class FSentryOutputDevice : public FOutputDevice | ||
{ | ||
public: | ||
virtual void Serialize( const TCHAR* V, ELogVerbosity::Type Verbosity, const FName& Category) override; | ||
|
||
virtual bool CanBeUsedOnAnyThread() const override; | ||
virtual bool CanBeUsedOnMultipleThreads() const override; | ||
virtual bool CanBeUsedOnPanicThread() const override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
version=2.30.2 | ||
version=2.31.0 | ||
repo=https://github.com/getsentry/sentry-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters