Logging for Unreal SDK
This page explains how to work with logging and error handling in the PubNub Unreal Software Development Kit (SDK).
By default all logs are printed to the Unreal Editor's Output Log.
To bind additional functionality, use PubnubSubsystem->OnPubnubError.AddDynamic()
.
Reference code
Set up your Unreal project and follow the instructions in the lines marked with
ACTION REQUIRED
before running the code.- C++
- Blueprint
PubnubSubsystem->OnPubnubError.AddDynamic(this, &UPubNubGameInstance::OnPubnubErrorReceived);
void UPubNubGameInstance::OnPubnubErrorReceived(FString ErrorMessage, EPubnubErrorType ErrorType)
{
// Do something with the error
}
Error handling with logging
The PubNub Unreal SDK provides an error handling system that complements the logging capabilities.
Binding to error events
Reference code
Set up your Unreal project and follow the instructions in the lines marked with
ACTION REQUIRED
before running the code.Checking response status in callbacks
Many SDK methods return status codes that you can use to log success or failure.
Reference code
Set up your Unreal project and follow the instructions in the lines marked with
ACTION REQUIRED
before running the code.Viewing logs
Logs generated by the PubNub Unreal SDK can be viewed in:
- Unreal Editor's Output Log window during development (Window → Developer Tools → Output Log).
- Debug console when running a packaged game with the console enabled.
- Log files located in your project's Saved/Logs directory.