Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #358 from DolbyIO/sdk26
Browse files Browse the repository at this point in the history
Sdk26
  • Loading branch information
Kuba Audykowicz authored Aug 11, 2023
2 parents 03b70a3 + f544bd5 commit 041afb9
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:

env:
CPP_SDK_TAG: "2.5.5"
CPP_SDK_TAG: "2.6.0-beta.1"
CPP_SDK_DESTINATION: "DolbyIO"
CPP_SDK_URL: "https://github.com/DolbyIO/comms-sdk-cpp/releases/download"
UNREAL_PLUGIN_OUTPUT: "Build/DolbyIO"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
packages: write

env:
CPP_SDK_TAG: "2.5.5"
CPP_SDK_TAG: "2.6.0-beta.1"
CPP_SDK_DESTINATION: "DolbyIO"
CPP_SDK_URL: "https://github.com/DolbyIO/comms-sdk-cpp/releases/download"
UNREAL_PLUGIN_OUTPUT: "Build/DolbyIO"
Expand Down
2 changes: 1 addition & 1 deletion DolbyIO/DolbyIO.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.2.0-beta.5",
"VersionName": "1.2.0-beta.7",
"FriendlyName": "Dolby.io Virtual Worlds",
"Description": "Plugin integrating Dolby.io Communications.",
"Category": "Communications",
Expand Down
31 changes: 30 additions & 1 deletion DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,36 @@ void UDolbyIOSubsystem::Deinitialize()
Super::Deinitialize();
}

namespace
{
class SdkLogCallback : public logger_sink_callback
{
public:
void log(log_level Level, std::string_view Message) const override
{
#define DLB_UE_LOG_SDK_BASE(Verbosity) \
DLB_UE_LOG_BASE(Verbosity, "%s", *ToFText(std::string{Message}).ToString()); \
return;
switch (Level)
{
case log_level::ERROR:
DLB_UE_LOG_SDK_BASE(Error);
case log_level::WARNING:
DLB_UE_LOG_SDK_BASE(Warning);
case log_level::INFO:
DLB_UE_LOG_SDK_BASE(Log);
case log_level::DEBUG:
DLB_UE_LOG_SDK_BASE(Verbose);
case log_level::VERBOSE:
DLB_UE_LOG_SDK_BASE(VeryVerbose);
default:;
}
}
};
}

void UDolbyIOSubsystem::SetLogSettings(EDolbyIOLogLevel SdkLogLevel, EDolbyIOLogLevel MediaLogLevel,
EDolbyIOLogLevel DvcLogLevel)
EDolbyIOLogLevel DvcLogLevel, bool bLogToConsole)
{
const FString& LogDir = FPaths::ProjectLogDir();
DLB_UE_LOG("Logs will be saved in directory %s", *LogDir);
Expand All @@ -58,6 +86,7 @@ void UDolbyIOSubsystem::SetLogSettings(EDolbyIOLogLevel SdkLogLevel, EDolbyIOLog
LogSettings.dvc_log_level = ToSdkLogLevel(DvcLogLevel);
LogSettings.log_directory = ToStdString(LogDir);
LogSettings.suppress_stdout_logs = true;
LogSettings.log_callback = bLogToConsole ? std::make_shared<SdkLogCallback>() : nullptr;
try
{
sdk::set_log_settings(LogSettings);
Expand Down
2 changes: 1 addition & 1 deletion DolbyIO/Source/Public/DolbyIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem
UFUNCTION(BlueprintCallable, Category = "Dolby.io Comms")
void SetLogSettings(EDolbyIOLogLevel SdkLogLevel = EDolbyIOLogLevel::Info,
EDolbyIOLogLevel MediaLogLevel = EDolbyIOLogLevel::Info,
EDolbyIOLogLevel DvcLogLevel = EDolbyIOLogLevel::Info);
EDolbyIOLogLevel DvcLogLevel = EDolbyIOLogLevel::Info, bool bLogToConsole = false);
UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms")
FDolbyIOOnErrorDelegate OnSetLogSettingsError;

Expand Down
4 changes: 2 additions & 2 deletions DolbyIO/Source/Public/DolbyIOBlueprints.h
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,9 @@ class UDolbyIOBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
Meta = (WorldContext = "WorldContextObject", DisplayName = "Dolby.io Set Log Settings"))
static void SetLogSettings(const UObject* WorldContextObject, EDolbyIOLogLevel SdkLogLevel = EDolbyIOLogLevel::Info,
EDolbyIOLogLevel MediaLogLevel = EDolbyIOLogLevel::Info,
EDolbyIOLogLevel DvcLogLevel = EDolbyIOLogLevel::Info)
EDolbyIOLogLevel DvcLogLevel = EDolbyIOLogLevel::Info, bool bLogToConsole = false)
{
DLB_EXECUTE_SUBSYSTEM_METHOD(SetLogSettings, SdkLogLevel, MediaLogLevel, DvcLogLevel);
DLB_EXECUTE_SUBSYSTEM_METHOD(SetLogSettings, SdkLogLevel, MediaLogLevel, DvcLogLevel, bLogToConsole);
}

/** Sets the audio input device.
Expand Down
11 changes: 6 additions & 5 deletions docs/docs/blueprints/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,12 @@ This function should be called before the first call to [Set Token](#dolbyio-set
![](../../static/img/generated/DolbyIOBlueprintFunctionLibrary/img/nd_img_SetLogSettings.png)

#### Inputs and outputs
| Name | Direction | Type | Default value | Description |
|---------------------|:----------|:--------------------------------------------------|:--------------|:---------------------------------|
| **Sdk Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for SDK logs. |
| **Media Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for Media Engine logs. |
| **Dvc Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for DVC logs. |
| Name | Direction | Type | Default value | Description |
|---------------------|:----------|:--------------------------------------------------|:--------------|:--------------------------------------------------------------------------|
| **Sdk Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for SDK logs. |
| **Media Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for Media Engine logs. |
| **Dvc Log Level** | Input | [Dolby.io Log Level](types.mdx#dolbyio-log-level) | Info | Log level for DVC logs. |
| **Log to Console** | Input | bool | false | Sets whether the C++ SDK logs should also be displayed in the Output Log. |

---

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 041afb9

Please sign in to comment.