CommonLoadingScreen.LogLoadingScreenReasonEveryFrame
CommonLoadingScreen.LogLoadingScreenReasonEveryFrame
#Overview
name: CommonLoadingScreen.LogLoadingScreenReasonEveryFrame
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When true, the reason the loading screen is shown or hidden will be printed to the log every frame.
It is referenced in 8
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of CommonLoadingScreen.LogLoadingScreenReasonEveryFrame is to enable debugging of the loading screen system by logging the reason for showing or hiding the loading screen every frame. This setting variable is primarily used for debugging and diagnostics of the loading screen behavior in Unreal Engine 5.
This setting variable is part of the CommonLoadingScreen plugin, which is likely a custom plugin developed for the Lyra project. It is used within the LoadingScreenManager subsystem of this plugin.
The value of this variable is set in two places:
- As a default value in the UCommonLoadingScreenSettings class.
- As a console variable that can be changed at runtime.
The associated variable LogLoadingScreenReasonEveryFrame interacts directly with it, sharing the same value and purpose. This variable is used within the LoadingScreenManager to determine whether to log the loading screen status.
Developers must be aware that enabling this variable may impact performance, especially in builds, as it will cause logging every frame when the loading screen is active. It should primarily be used for debugging purposes and not left enabled in production builds.
Best practices when using this variable include:
- Use it temporarily for debugging loading screen issues.
- Disable it in production builds to avoid performance overhead.
- Use in conjunction with other debugging tools to get a comprehensive view of loading screen behavior.
Regarding the associated variable LogLoadingScreenReasonEveryFrame: This variable is used directly in the UpdateLoadingScreen function of the LoadingScreenManager. It determines whether to log the loading screen status every frame. It shares the same purpose and considerations as the CommonLoadingScreen.LogLoadingScreenReasonEveryFrame console variable. Developers should treat it with the same caution, using it for debugging purposes and ensuring it’s disabled in production to avoid unnecessary logging overhead.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h:47
Scope (from outer to inner):
file
class class UCommonLoadingScreenSettings : public UDeveloperSettingsBackedByCVars
Source code excerpt:
// When true, the reason the loading screen is shown or hidden will be printed to the log every frame.
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.LogLoadingScreenReasonEveryFrame"))
bool LogLoadingScreenReasonEveryFrame = 0;
// Force the loading screen to be displayed (useful for debugging)
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.AlwaysShow"))
bool ForceLoadingScreenVisible = false;
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:78
Scope (from outer to inner):
file
namespace LoadingScreenCVars
Source code excerpt:
static bool LogLoadingScreenReasonEveryFrame = false;
static FAutoConsoleVariableRef CVarLogLoadingScreenReasonEveryFrame(
TEXT("CommonLoadingScreen.LogLoadingScreenReasonEveryFrame"),
LogLoadingScreenReasonEveryFrame,
TEXT("When true, the reason the loading screen is shown or hidden will be printed to the log every frame."),
ECVF_Default);
static bool ForceLoadingScreenVisible = false;
static FAutoConsoleVariableRef CVarForceLoadingScreenVisible(
#Associated Variable and Callsites
This variable is associated with another variable named LogLoadingScreenReasonEveryFrame
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h:45
Scope (from outer to inner):
file
class class UCommonLoadingScreenSettings : public UDeveloperSettingsBackedByCVars
Source code excerpt:
UPROPERTY(config, EditAnywhere, Category=Configuration, meta=(ForceUnits=s))
float LogLoadingScreenHeartbeatInterval = 5.0f;
// When true, the reason the loading screen is shown or hidden will be printed to the log every frame.
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.LogLoadingScreenReasonEveryFrame"))
bool LogLoadingScreenReasonEveryFrame = 0;
// Force the loading screen to be displayed (useful for debugging)
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.AlwaysShow"))
bool ForceLoadingScreenVisible = false;
// Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor
// (useful when iterating on loading screens)
UPROPERTY(Transient, EditAnywhere, Category=Debugging)
bool HoldLoadingScreenAdditionalSecsEvenInEditor = false;
// Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:73
Scope (from outer to inner):
file
namespace LoadingScreenCVars
Source code excerpt:
TEXT("CommonLoadingScreen.HoldLoadingScreenAdditionalSecs"),
HoldLoadingScreenAdditionalSecs,
TEXT("How long to hold the loading screen up after other loading finishes (in seconds) to try to give texture streaming a chance to avoid blurriness"),
ECVF_Default | ECVF_Preview);
static bool LogLoadingScreenReasonEveryFrame = false;
static FAutoConsoleVariableRef CVarLogLoadingScreenReasonEveryFrame(
TEXT("CommonLoadingScreen.LogLoadingScreenReasonEveryFrame"),
LogLoadingScreenReasonEveryFrame,
TEXT("When true, the reason the loading screen is shown or hidden will be printed to the log every frame."),
ECVF_Default);
static bool ForceLoadingScreenVisible = false;
static FAutoConsoleVariableRef CVarForceLoadingScreenVisible(
TEXT("CommonLoadingScreen.AlwaysShow"),
ForceLoadingScreenVisible,
TEXT("Force the loading screen to show."),
ECVF_Default);
}
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:210
Scope (from outer to inner):
file
function void ULoadingScreenManager::UpdateLoadingScreen
Source code excerpt:
}
}
void ULoadingScreenManager::UpdateLoadingScreen()
{
bool bLogLoadingScreenStatus = LoadingScreenCVars::LogLoadingScreenReasonEveryFrame;
if (ShouldShowLoadingScreen())
{
const UCommonLoadingScreenSettings* Settings = GetDefault<UCommonLoadingScreenSettings>();
// If we don't make it to the specified checkpoint in the given time will trigger the hang detector so we can better determine where progress stalled.
FThreadHeartBeat::Get().MonitorCheckpointStart(GetFName(), Settings->LoadingScreenHeartbeatHangDuration);
ShowLoadingScreen();
if ((Settings->LogLoadingScreenHeartbeatInterval > 0.0f) && (TimeUntilNextLogHeartbeatSeconds <= 0.0))
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h:45
Scope (from outer to inner):
file
class class UCommonLoadingScreenSettings : public UDeveloperSettingsBackedByCVars
Source code excerpt:
UPROPERTY(config, EditAnywhere, Category=Configuration, meta=(ForceUnits=s))
float LogLoadingScreenHeartbeatInterval = 5.0f;
// When true, the reason the loading screen is shown or hidden will be printed to the log every frame.
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.LogLoadingScreenReasonEveryFrame"))
bool LogLoadingScreenReasonEveryFrame = 0;
// Force the loading screen to be displayed (useful for debugging)
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.AlwaysShow"))
bool ForceLoadingScreenVisible = false;
// Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor
// (useful when iterating on loading screens)
UPROPERTY(Transient, EditAnywhere, Category=Debugging)
bool HoldLoadingScreenAdditionalSecsEvenInEditor = false;
// Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:73
Scope (from outer to inner):
file
namespace LoadingScreenCVars
Source code excerpt:
TEXT("CommonLoadingScreen.HoldLoadingScreenAdditionalSecs"),
HoldLoadingScreenAdditionalSecs,
TEXT("How long to hold the loading screen up after other loading finishes (in seconds) to try to give texture streaming a chance to avoid blurriness"),
ECVF_Default | ECVF_Preview);
static bool LogLoadingScreenReasonEveryFrame = false;
static FAutoConsoleVariableRef CVarLogLoadingScreenReasonEveryFrame(
TEXT("CommonLoadingScreen.LogLoadingScreenReasonEveryFrame"),
LogLoadingScreenReasonEveryFrame,
TEXT("When true, the reason the loading screen is shown or hidden will be printed to the log every frame."),
ECVF_Default);
static bool ForceLoadingScreenVisible = false;
static FAutoConsoleVariableRef CVarForceLoadingScreenVisible(
TEXT("CommonLoadingScreen.AlwaysShow"),
ForceLoadingScreenVisible,
TEXT("Force the loading screen to show."),
ECVF_Default);
}
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:210
Scope (from outer to inner):
file
function void ULoadingScreenManager::UpdateLoadingScreen
Source code excerpt:
}
}
void ULoadingScreenManager::UpdateLoadingScreen()
{
bool bLogLoadingScreenStatus = LoadingScreenCVars::LogLoadingScreenReasonEveryFrame;
if (ShouldShowLoadingScreen())
{
const UCommonLoadingScreenSettings* Settings = GetDefault<UCommonLoadingScreenSettings>();
// If we don't make it to the specified checkpoint in the given time will trigger the hang detector so we can better determine where progress stalled.
FThreadHeartBeat::Get().MonitorCheckpointStart(GetFName(), Settings->LoadingScreenHeartbeatHangDuration);
ShowLoadingScreen();
if ((Settings->LogLoadingScreenHeartbeatInterval > 0.0f) && (TimeUntilNextLogHeartbeatSeconds <= 0.0))