OutputLogModule.HideConsole

OutputLogModule.HideConsole

#Overview

name: OutputLogModule.HideConsole

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of OutputLogModule.HideConsole is to control the visibility of debug console widgets in the Unreal Engine’s output log system.

This setting variable is primarily used by the Output Log module, which is part of the Unreal Engine’s debugging and logging system. It’s also referenced in the Switchboard Listener, which is likely a separate tool or plugin used for remote debugging or monitoring.

The value of this variable is set through the console variable system in Unreal Engine. It can be set programmatically, as seen in the SwitchboardListener code, or through the console command system.

The OutputLogModule.HideConsole variable interacts directly with a boolean variable named bHideConsole. They share the same value, with bHideConsole being the actual variable that controls the behavior within the Output Log module.

Developers must be aware that changing this variable will affect the visibility of debug console widgets across the entire engine. Setting it to true will hide these widgets, which might impact debugging workflows.

Best practices when using this variable include:

  1. Only hiding the console when necessary, as it may contain valuable debugging information.
  2. If hiding the console programmatically, consider providing a way to re-enable it if needed.
  3. Be aware of the impact on other team members or processes that might rely on the visibility of these console widgets.

Regarding the associated variable bHideConsole:

The purpose of bHideConsole is to serve as the internal representation of the OutputLogModule.HideConsole setting within the Output Log module.

This variable is used directly within the Output Log module to control the visibility of debug console widgets. It’s checked in various places to determine whether to display or hide these widgets.

The value of bHideConsole is set indirectly through the OutputLogModule.HideConsole console variable. Any changes to OutputLogModule.HideConsole will be reflected in bHideConsole.

bHideConsole interacts closely with the OutputLogModule.HideConsole console variable, essentially serving as its internal counterpart.

Developers should be aware that modifying bHideConsole directly is not the recommended approach. Instead, they should use the OutputLogModule.HideConsole console variable to control this setting.

Best practices for bHideConsole include:

  1. Treat it as a read-only variable within your code, relying on the console variable system to modify its value.
  2. Use the FOutputLogModule::ShouldHideConsole() method to check its value, rather than accessing bHideConsole directly.
  3. Be aware that changes to this variable can affect the behavior of the entire Output Log module.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Developer/OutputLog/Private/OutputLogModule.cpp:41

Scope (from outer to inner):

file
namespace    OutputLogModule

Source code excerpt:

	bool bHideConsole = false;
	FAutoConsoleVariableRef CVarHideConsoleCommand(
		TEXT("OutputLogModule.HideConsole"), 
		bHideConsole, 
		TEXT("Whether debug console widgets should be hidden (false by default)"), 
		FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* /*CVar*/)
			{
				if (bHideConsole)
				{

#Loc: <Workspace>/Engine/Source/Programs/SwitchboardListener/SblSlate/Private/SblMainWindow.cpp:110

Scope (from outer to inner):

file
function     void FSwitchboardListenerMainWindow::OnInit

Source code excerpt:

	FModuleManager::Get().LoadModuleChecked("OutputLog");

	if (IConsoleVariable* HideConsoleCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("OutputLogModule.HideConsole")); ensure(HideConsoleCVar))
	{
		HideConsoleCVar->Set(true);
	}

	CustomizeToolMenus();

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Developer/OutputLog/Private/OutputLogModule.cpp:39

Scope (from outer to inner):

file
namespace    OutputLogModule

Source code excerpt:

	static const FName DeviceOutputLogTabName = FName(TEXT("DeviceOutputLog"));

	bool bHideConsole = false;
	FAutoConsoleVariableRef CVarHideConsoleCommand(
		TEXT("OutputLogModule.HideConsole"), 
		bHideConsole, 
		TEXT("Whether debug console widgets should be hidden (false by default)"), 
		FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* /*CVar*/)
			{
				if (bHideConsole)
				{
					FOutputLogModule::Get().CloseDebugConsole();

#Loc: <Workspace>/Engine/Source/Developer/OutputLog/Private/OutputLogModule.cpp:199

Scope (from outer to inner):

file
function     bool FOutputLogModule::ShouldHideConsole

Source code excerpt:

bool FOutputLogModule::ShouldHideConsole() const
{
	return OutputLogModule::bHideConsole;
}

TSharedRef<SWidget> FOutputLogModule::MakeConsoleInputBox(TSharedPtr<SMultiLineEditableTextBox>& OutExposedEditableTextBox, const FSimpleDelegate& OnCloseConsole, const FSimpleDelegate& OnConsoleCommandExecuted) const
{
	TSharedRef<SConsoleInputBox> NewConsoleInputBox =
		SNew(SConsoleInputBox)