diff --git a/CHANGELOG.md b/CHANGELOG.md index 49fb9bd4..db3815d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- Map sentry_level_t to ELogVerbosity::Type in PrintVerboseLog ([#536](https://github.com/getsentry/sentry-unreal/pull/536)) + + ### Features - Add user feedback capturing support for desktop ([#521](https://github.com/getsentry/sentry-unreal/pull/521)) diff --git a/plugin-dev/Source/Sentry/Private/Desktop/SentrySubsystemDesktop.cpp b/plugin-dev/Source/Sentry/Private/Desktop/SentrySubsystemDesktop.cpp index 95c5a148..f20e3e15 100644 --- a/plugin-dev/Source/Sentry/Private/Desktop/SentrySubsystemDesktop.cpp +++ b/plugin-dev/Source/Sentry/Private/Desktop/SentrySubsystemDesktop.cpp @@ -46,7 +46,27 @@ void PrintVerboseLog(sentry_level_t level, const char *message, va_list args, vo char buffer[512]; vsnprintf(buffer, 512, message, args); - UE_LOG(LogSentrySdk, Log, TEXT("%s"), *FString(buffer)); + switch (level) + { + case SENTRY_LEVEL_DEBUG: + UE_LOG(LogSentrySdk, Verbose, TEXT("%s"), *FString(buffer)); + break; + case SENTRY_LEVEL_INFO: + UE_LOG(LogSentrySdk, Log, TEXT("%s"), *FString(buffer)); + break; + case SENTRY_LEVEL_WARNING: + UE_LOG(LogSentrySdk, Warning, TEXT("%s"), *FString(buffer)); + break; + case SENTRY_LEVEL_ERROR: + UE_LOG(LogSentrySdk, Error, TEXT("%s"), *FString(buffer)); + break; + case SENTRY_LEVEL_FATAL: + UE_LOG(LogSentrySdk, Fatal, TEXT("%s"), *FString(buffer)); + break; + default: + UE_LOG(LogSentrySdk, Error, TEXT("Unknown sentry_level: %d"), level); + UE_LOG(LogSentrySdk, Error, TEXT("%s"), *FString(buffer)); + } } sentry_value_t HandleBeforeSend(sentry_value_t event, void *hint, void *closure)