EnhancedInput.bShouldLogAllWorldSubsystemInputs

EnhancedInput.bShouldLogAllWorldSubsystemInputs

#Overview

name: EnhancedInput.bShouldLogAllWorldSubsystemInputs

This variable is created as a Console Variable (cvar).

It is referenced in 9 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of EnhancedInput.bShouldLogAllWorldSubsystemInputs is to enable logging of all input processed by the Enhanced Input world subsystem, including keypresses and analog values. This setting is primarily used for debugging purposes within the Enhanced Input system.

This setting variable is part of the Enhanced Input plugin, which is an extension of Unreal Engine’s input system. It specifically relates to the World Subsystem component of the Enhanced Input system.

The value of this variable is set in multiple places:

  1. It is initialized as a static boolean in the ConsoleVariables namespace (EnhancedInputDeveloperSettings.cpp).
  2. It is defined as a configurable property in the UEnhancedInputDeveloperSettings class (EnhancedInputDeveloperSettings.h).
  3. It is set to false by default in the UEnhancedInputDeveloperSettings constructor (EnhancedInputDeveloperSettings.cpp).

This variable interacts with the bEnableWorldSubsystem variable, as indicated by the meta tag in the UPROPERTY declaration.

Developers must be aware that:

  1. This setting can produce a large volume of logs and should only be used for debugging purposes.
  2. It has no effect in shipping builds due to the #if !UE_BUILD_SHIPPING preprocessor directive.
  3. It is tied to the World Subsystem being enabled (bEnableWorldSubsystem).

Best practices when using this variable include:

  1. Only enable it temporarily for debugging specific input-related issues.
  2. Disable it in production or performance-critical scenarios to avoid performance overhead from excessive logging.
  3. Use in conjunction with other Enhanced Input debugging tools for comprehensive input analysis.

Regarding the associated variable bShouldLogAllWorldSubsystemInputs: This is the actual boolean variable that stores the state of the logging setting. It is used in the UEnhancedInputWorldSubsystem::InputKey function to determine whether to log input events. The console variable and the UPROPERTY in the developer settings both control this underlying boolean. The same considerations and best practices apply to this variable as to the console variable.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputDeveloperSettings.cpp:14

Scope (from outer to inner):

file
namespace    UE::EnhancedInput::Private
namespace    ConsoleVariables

Source code excerpt:

		static bool bShouldLogAllWorldSubsystemInputs = false;
		static FAutoConsoleVariableRef CVarShouldLogAllWorldSubsystemInputs(
			TEXT("EnhancedInput.bShouldLogAllWorldSubsystemInputs"),
			bShouldLogAllWorldSubsystemInputs,
			TEXT("Should each InputKey call to the World subsystem be logged?"),
			ECVF_Cheat);
	}
}

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Public/EnhancedInputDeveloperSettings.h:132

Scope (from outer to inner):

file
class        class UEnhancedInputDeveloperSettings : public UDeveloperSettingsBackedByCVars

Source code excerpt:

 	 * Note: This can produce A LOT of logs, so only use this if you are debugging something. Does nothing in shipping builds
 	 */
	UPROPERTY(config, EditAnywhere, Category = "Enhanced Input|World Subsystem", meta=(editCondition = "bEnableWorldSubsystem", ConsoleVariable="EnhancedInput.bShouldLogAllWorldSubsystemInputs"))
	uint8 bShouldLogAllWorldSubsystemInputs : 1;
};

#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2
#include "CoreMinimal.h"
#endif

#Associated Variable and Callsites

This variable is associated with another variable named bShouldLogAllWorldSubsystemInputs. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputDeveloperSettings.cpp:9

Scope (from outer to inner):

file
namespace    UE::EnhancedInput::Private
namespace    ConsoleVariables

Source code excerpt:


namespace UE::EnhancedInput::Private
{
	namespace ConsoleVariables
	{
		static bool bShouldLogAllWorldSubsystemInputs = false;
		static FAutoConsoleVariableRef CVarShouldLogAllWorldSubsystemInputs(
			TEXT("EnhancedInput.bShouldLogAllWorldSubsystemInputs"),
			bShouldLogAllWorldSubsystemInputs,
			TEXT("Should each InputKey call to the World subsystem be logged?"),
			ECVF_Cheat);
	}
}

UEnhancedInputDeveloperSettings::UEnhancedInputDeveloperSettings(const FObjectInitializer& Initializer)
	: Super(Initializer)
	, UserSettingsClass(UEnhancedInputUserSettings::StaticClass())
	, DefaultPlayerMappableKeyProfileClass(UEnhancedPlayerMappableKeyProfile::StaticClass())
	, DefaultWorldInputClass(UEnhancedPlayerInput::StaticClass())
	, bSendTriggeredEventsWhenInputIsFlushed(true)
	, bEnableUserSettings(false)
	, bEnableDefaultMappingContexts(true)
	, bShouldOnlyTriggerLastActionInChord(true)
	, bLogOnDeprecatedConfigUsed(true)
	, bEnableWorldSubsystem(false)
	, bShouldLogAllWorldSubsystemInputs(false)
{
	PlatformSettings.Initialize(UEnhancedInputPlatformSettings::StaticClass());
}

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputDeveloperSettings.cpp:29

Scope (from outer to inner):

file
function     UEnhancedInputDeveloperSettings::UEnhancedInputDeveloperSettings

Source code excerpt:

	, bLogOnDeprecatedConfigUsed(true)
	, bEnableWorldSubsystem(false)
	, bShouldLogAllWorldSubsystemInputs(false)
{
	PlatformSettings.Initialize(UEnhancedInputPlatformSettings::StaticClass());
}

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputSubsystems.cpp:256

Scope (from outer to inner):

file
function     bool UEnhancedInputWorldSubsystem::InputKey

Source code excerpt:

{
	if (PlayerInput)
	{

#if !UE_BUILD_SHIPPING
		if (GetDefault<UEnhancedInputDeveloperSettings>()->bShouldLogAllWorldSubsystemInputs)
		{
			UE_LOG(LogWorldSubsystemInput, VeryVerbose, TEXT("EI %s World Subsystem InputKey : [%s]"), LexToString(GetWorld()->WorldType), *Params.Key.ToString());
		}
#endif

		return PlayerInput->InputKey(Params);
	}

	ensureAlwaysMsgf(false, TEXT("Attempting to input a key to the EnhancedInputWorldSubsystem, but there is no Player Input!"));
	return false;
}

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Public/EnhancedInputDeveloperSettings.h:130

Scope (from outer to inner):

file
class        class UEnhancedInputDeveloperSettings : public UDeveloperSettingsBackedByCVars

Source code excerpt:

	/**
 	 * If true then the Enhanced Input world subsystem will log all input that is being processed by it (keypresses, analog values, etc)
 	 * Note: This can produce A LOT of logs, so only use this if you are debugging something. Does nothing in shipping builds
 	 */
	UPROPERTY(config, EditAnywhere, Category = "Enhanced Input|World Subsystem", meta=(editCondition = "bEnableWorldSubsystem", ConsoleVariable="EnhancedInput.bShouldLogAllWorldSubsystemInputs"))
	uint8 bShouldLogAllWorldSubsystemInputs : 1;
};

#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2
#include "CoreMinimal.h"
#endif

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputDeveloperSettings.cpp:9

Scope (from outer to inner):

file
namespace    UE::EnhancedInput::Private
namespace    ConsoleVariables

Source code excerpt:


namespace UE::EnhancedInput::Private
{
	namespace ConsoleVariables
	{
		static bool bShouldLogAllWorldSubsystemInputs = false;
		static FAutoConsoleVariableRef CVarShouldLogAllWorldSubsystemInputs(
			TEXT("EnhancedInput.bShouldLogAllWorldSubsystemInputs"),
			bShouldLogAllWorldSubsystemInputs,
			TEXT("Should each InputKey call to the World subsystem be logged?"),
			ECVF_Cheat);
	}
}

UEnhancedInputDeveloperSettings::UEnhancedInputDeveloperSettings(const FObjectInitializer& Initializer)
	: Super(Initializer)
	, UserSettingsClass(UEnhancedInputUserSettings::StaticClass())
	, DefaultPlayerMappableKeyProfileClass(UEnhancedPlayerMappableKeyProfile::StaticClass())
	, DefaultWorldInputClass(UEnhancedPlayerInput::StaticClass())
	, bSendTriggeredEventsWhenInputIsFlushed(true)
	, bEnableUserSettings(false)
	, bEnableDefaultMappingContexts(true)
	, bShouldOnlyTriggerLastActionInChord(true)
	, bLogOnDeprecatedConfigUsed(true)
	, bEnableWorldSubsystem(false)
	, bShouldLogAllWorldSubsystemInputs(false)
{
	PlatformSettings.Initialize(UEnhancedInputPlatformSettings::StaticClass());
}

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputSubsystems.cpp:256

Scope (from outer to inner):

file
function     bool UEnhancedInputWorldSubsystem::InputKey

Source code excerpt:

{
	if (PlayerInput)
	{

#if !UE_BUILD_SHIPPING
		if (GetDefault<UEnhancedInputDeveloperSettings>()->bShouldLogAllWorldSubsystemInputs)
		{
			UE_LOG(LogWorldSubsystemInput, VeryVerbose, TEXT("EI %s World Subsystem InputKey : [%s]"), LexToString(GetWorld()->WorldType), *Params.Key.ToString());
		}
#endif

		return PlayerInput->InputKey(Params);
	}

	ensureAlwaysMsgf(false, TEXT("Attempting to input a key to the EnhancedInputWorldSubsystem, but there is no Player Input!"));
	return false;
}

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Public/EnhancedInputDeveloperSettings.h:130

Scope (from outer to inner):

file
class        class UEnhancedInputDeveloperSettings : public UDeveloperSettingsBackedByCVars

Source code excerpt:

	/**
 	 * If true then the Enhanced Input world subsystem will log all input that is being processed by it (keypresses, analog values, etc)
 	 * Note: This can produce A LOT of logs, so only use this if you are debugging something. Does nothing in shipping builds
 	 */
	UPROPERTY(config, EditAnywhere, Category = "Enhanced Input|World Subsystem", meta=(editCondition = "bEnableWorldSubsystem", ConsoleVariable="EnhancedInput.bShouldLogAllWorldSubsystemInputs"))
	uint8 bShouldLogAllWorldSubsystemInputs : 1;
};

#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2
#include "CoreMinimal.h"
#endif