DumpConsoleCommands
DumpConsoleCommands
#Overview
name: DumpConsoleCommands
This variable is created as a Console Variable (cvar).
- type:
Cmd
- help:
Dumps all console vaiables and commands and all exec that can be discovered to the log/console
It is referenced in 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of DumpConsoleCommands is to provide a debugging and development tool that allows developers to list all available console variables, commands, and executable functions (execs) in the Unreal Engine 5 environment.
This console command is primarily used in the Core and Engine modules of Unreal Engine 5, specifically in the debugging and development processes. It is not tied to a specific subsystem but rather serves as a utility for developers across various parts of the engine.
The value of this variable is not set in the traditional sense, as it is a console command rather than a variable. It is registered as a console command in the CreateConsoleVariables() function within the ConsoleManager.cpp file.
DumpConsoleCommands interacts with the ConsoleCommandLibrary class, which is responsible for gathering, sorting, and logging all available commands when the DumpConsoleCommands command is executed.
Developers should be aware that:
- This command is only available in non-shipping builds (defined by !UE_BUILD_SHIPPING).
- It outputs a large amount of information to the log/console, which can be overwhelming but useful for debugging.
- The command is often used in conjunction with other debugging tools and commands.
Best practices when using this variable include:
- Use it during development and debugging phases, not in production or shipping builds.
- Combine it with filtering or searching mechanisms to find specific commands or variables of interest.
- Consider using it in conjunction with the “RedirectToFile” command to output the results to a file for easier analysis.
- Be aware that the output may change as the engine evolves or as plugins are added or removed from the project.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:3378
Scope (from outer to inner):
file
function void CreateConsoleVariables
Source code excerpt:
#if !UE_BUILD_SHIPPING
IConsoleManager::Get().RegisterConsoleCommand( TEXT( "DumpConsoleCommands" ), TEXT( "Dumps all console vaiables and commands and all exec that can be discovered to the log/console" ), ECVF_Default );
IConsoleManager::Get().RegisterConsoleCommand( TEXT( "RedirectToFile" ),
TEXT( "Creates a file inside Project's Saved folder and outputs command result into it as well as into the log.\n" )
TEXT( "Usage: RedirectToFile <filepath/filename> <command> [command arguments]\n" )
TEXT( "Example: RedirectToFile Profiling/CSV/objlist.csv obj list -csv -all\n" )
TEXT( "Directory structure under Project/Saved folder specified by <filepath> will be created for you if it doesn't exist." ),
ECVF_Default );
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/Parse.cpp:20
Scope: file
Source code excerpt:
#if !UE_BUILD_SHIPPING
/**
* Needed for the console command "DumpConsoleCommands"
* How it works:
* - GConsoleCommandLibrary is set to point at a local instance of ConsoleCommandLibrary
* - a dummy command search is triggered which gathers all commands in a hashed set
* - sort all gathered commands in human friendly way
* - log all commands
* - GConsoleCommandLibrary is set 0
*/
class ConsoleCommandLibrary
{
public:
ConsoleCommandLibrary(const FString& InPattern);
~ConsoleCommandLibrary();
#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/Parse.h:22
Scope: file
Source code excerpt:
* Sees if Stream starts with the named command. If it does,
* skips through the command and blanks past it. Returns true of match.
* @param bParseMightTriggerExecution true: Caller guarantees this is only part of parsing and no execution happens without further parsing (good for "DumpConsoleCommands").
*/
static CORE_API bool Command( const TCHAR** Stream, const TCHAR* Match, bool bParseMightTriggerExecution = true );
/** Parses a name. */
static CORE_API bool Value( const TCHAR* Stream, const TCHAR* Match, FName& Name );
/** Parses a uint32. */
static CORE_API bool Value( const TCHAR* Stream, const TCHAR* Match, uint32& Value );
/** Parses a globally unique identifier. */
static CORE_API bool Value( const TCHAR* Stream, const TCHAR* Match, struct FGuid& Guid );
/** Parses a string from a text string.
* @param Stream, the string you want to extract the value from.
#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/Parse.h:189
Scope: file
Source code excerpt:
#if !UE_BUILD_SHIPPING
/** Needed for the console command "DumpConsoleCommands" */
CORE_API bool ConsoleCommandLibrary_DumpLibrary(class UWorld* InWorld, FExec& SubSystem, const FString& Pattern, FOutputDevice& Ar);
/** Needed for the console command "Help" */
CORE_API bool ConsoleCommandLibrary_DumpLibraryHTML(class UWorld* InWorld, FExec& SubSystem, const FString& OutPath);
#endif // !UE_BUILD_SHIPPING
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Tests/ExecCommandsTests.cpp:229
Scope (from outer to inner):
file
function bool FCommonCommandsExecCommandTest::RunTest
Source code excerpt:
#if STATS
CommonCommands.Emplace(TEXT("stat")); // Prefix for the stat commands. The specific commands themselves are not gathered by DumpConsoleCommands.
#endif
if (GEngine->IsA<UGameEngine>())
{
CommonCommands.Emplace(TEXT("quit"));
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Tests/ExecCommandsTests.cpp:262
Scope (from outer to inner):
file
function bool FCommonCommandsExecCommandTest::RunTest
Source code excerpt:
TArray<FString> CommandList;
ConsoleCommandsDump.ParseIntoArrayLines(CommandList);
CommandList.RemoveAt(0); // Remove the first entry as its not sorted and is something like DumpConsoleCommands:*
for ( const FString& CommonCommand : CommonCommands )
{
const bool bCommandFound = ( Algo::BinarySearch(CommandList, CommonCommand) != INDEX_NONE );
TestTrue( FString::Printf( TEXT("%s failed to execute."), *CommonCommand ), bCommandFound );
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:4994
Scope (from outer to inner):
file
function bool UEngine::Exec_Dev
Source code excerpt:
{
#if !UE_BUILD_SHIPPING
if (FParse::Command(&Cmd, TEXT("DumpConsoleCommands")))
{
return HandleDumpConsoleCommandsCommand( Cmd, Ar, InWorld );
}
else if (FParse::Command(&Cmd, TEXT("REDIRECTTOFILE")))
{
return HandleRedirectOutputCommand( Cmd, Ar, InWorld );