ts.debug.PrintTargetingDebugToLog
ts.debug.PrintTargetingDebugToLog
#Overview
name: ts.debug.PrintTargetingDebugToLog
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Toggles we print the targeting debug text to the log. (Enabled: true, Disabled: false)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ts.debug.PrintTargetingDebugToLog is to toggle the printing of targeting debug text to the log in the Gameplay Targeting System plugin for Unreal Engine 5.
This setting variable is primarily used by the Gameplay Targeting System plugin, which is an experimental plugin in Unreal Engine 5. Specifically, it’s utilized within the TargetingSubsystem module.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as a boolean FAutoConsoleVariableRef, which allows it to be changed at runtime through the console or configuration files.
The associated variable bPrintTargetingDebugToLog directly interacts with ts.debug.PrintTargetingDebugToLog. They share the same value, with bPrintTargetingDebugToLog being the actual boolean variable used in the code, while ts.debug.PrintTargetingDebugToLog is the console command to modify it.
Developers must be aware that this is a debug-only variable and should not be used in production builds. It’s intended for development and debugging purposes only. Enabling this variable may have performance implications due to increased logging.
Best practices when using this variable include:
- Only enable it when actively debugging targeting issues.
- Disable it in production builds to avoid unnecessary performance overhead.
- Use it in conjunction with other debugging tools for a comprehensive understanding of the targeting system.
Regarding the associated variable bPrintTargetingDebugToLog:
The purpose of bPrintTargetingDebugToLog is to store the actual boolean value that determines whether targeting debug text should be printed to the log.
This variable is used within the TargetingSubsystem of the Gameplay Targeting System plugin. It’s referenced in the DisplayDebug function of the UTargetingSubsystem class.
The value of bPrintTargetingDebugToLog is set by the console variable ts.debug.PrintTargetingDebugToLog. It interacts directly with the console variable system.
Developers should be aware that this variable is part of the internal workings of the targeting system’s debug functionality. It shouldn’t be modified directly in code, but rather through the console variable system.
Best practices for bPrintTargetingDebugToLog include:
- Treat it as a read-only variable in your code.
- Use the console variable ts.debug.PrintTargetingDebugToLog to modify its value.
- Consider wrapping access to this variable in debug-only code blocks to ensure it doesn’t affect release builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:54
Scope (from outer to inner):
file
namespace TargetingSystemCVars
Source code excerpt:
static bool bPrintTargetingDebugToLog = false;
FAutoConsoleVariableRef CvarPrintTargetingDebugToLog(
TEXT("ts.debug.PrintTargetingDebugToLog"),
bPrintTargetingDebugToLog,
TEXT("Toggles we print the targeting debug text to the log. (Enabled: true, Disabled: false)")
);
static int32 TotalDebugRecentRequestsTracked = 5;
FAutoConsoleVariableRef CvarTotalDebugRecentRequestsTracked(
#Associated Variable and Callsites
This variable is associated with another variable named bPrintTargetingDebugToLog
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:52
Scope (from outer to inner):
file
namespace TargetingSystemCVars
Source code excerpt:
);
static bool bPrintTargetingDebugToLog = false;
FAutoConsoleVariableRef CvarPrintTargetingDebugToLog(
TEXT("ts.debug.PrintTargetingDebugToLog"),
bPrintTargetingDebugToLog,
TEXT("Toggles we print the targeting debug text to the log. (Enabled: true, Disabled: false)")
);
static int32 TotalDebugRecentRequestsTracked = 5;
FAutoConsoleVariableRef CvarTotalDebugRecentRequestsTracked(
TEXT("ts.debug.TotalDebugRecentRequestsTracked"),
#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:801
Scope (from outer to inner):
file
function void UTargetingSubsystem::DisplayDebug
Source code excerpt:
FTargetingDebugInfo DebugInfo;
DebugInfo.bPrintToLog = TargetingSystemCVars::bPrintTargetingDebugToLog;
DebugInfo.Canvas = Canvas;
DebugInfo.XPos = 0.f;
DebugInfo.YPos = YPos;
DebugInfo.OriginalX = 0.f;
DebugInfo.OriginalY = YPos;
DebugInfo.MaxY = Canvas->ClipY - 150.f; // Give some padding for any non-columnizing debug output following this output