This document describes how to use Unreal NHN Cloud Logger SDK.
Initialize NHN Cloud Logger SDK with appkey issued from Log & Crash Search.
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID ■ UNREAL_WINDOWS
void Initialize(const FGamebaseLoggerConfiguration& loggerConfiguration);
Example
void Sample::InitializeLogger()
{
FGamebaseLoggerConfiguration configuration{ "USER_LOGGER_APP_KEY", enableCrashReporter };
IGamebase::Get().GetLogger().Initialize(configuration);
}
Send logs to Log & Crash Server. NHN Cloud Logger SDK can send logs of the five levels as below:
Logs are levelled as follows:
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID ■ UNREAL_WINDOWS
void Debug(const FString& message, const TMap<FString, FString>& userFields = TMap<FString, FString>());
void Info(const FString& message, const TMap<FString, FString>& userFields = TMap<FString, FString>());
void Warn(const FString& message, const TMap<FString, FString>& userFields = TMap<FString, FString>());
void Error(const FString& message, const TMap<FString, FString>& userFields = TMap<FString, FString>());
void Fatal(const FString& message, const TMap<FString, FString>& userFields = TMap<FString, FString>());
Example
void Sample::DebugLogger()
{
TMap<FString, FString> userFields;
userFields.Add("KEY_1", "VALUE_1");
userFields.Add("KEY_2", "VALUE_2");
IGamebase::Get().GetLogger().Debug("MESSAGE", userFields);
}
void Sample::InfoLogger()
{
TMap<FString, FString> userFields;
userFields.Add("KEY_1", "VALUE_1");
userFields.Add("KEY_2", "VALUE_2");
IGamebase::Get().GetLogger().Info("MESSAGE", userFields);
}
void Sample::WarnLogger()
{
TMap<FString, FString> userFields;
userFields.Add("KEY_1", "VALUE_1");
userFields.Add("KEY_2", "VALUE_2");
IGamebase::Get().GetLogger().Warn("MESSAGE", userFields);
}
void Sample::ErrorLogger()
{
TMap<FString, FString> userFields;
userFields.Add("KEY_1", "VALUE_1");
userFields.Add("KEY_2", "VALUE_2");
IGamebase::Get().GetLogger().Error("MESSAGE", userFields);
}
void Sample::FatalLogger()
{
TMap<FString, FString> userFields;
userFields.Add("KEY_1", "VALUE_1");
userFields.Add("KEY_2", "VALUE_2");
IGamebase::Get().GetLogger().Fatal("MESSAGE", userFields);
}
Set user-defined field as needed. With user-defined field setting, set value is sent to server along with logs every time Send Logs API is called.
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID ■ UNREAL_WINDOWS
void SetUserField(const FString& key, const FString& value);
Example
void Sample::SetLoggerUserField()
{
IGamebase::Get().GetLogger().SetUserField("KEY", "VALUE");
}