con.MinLogVerbosity

con.MinLogVerbosity

#Overview

name: con.MinLogVerbosity

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of con.MinLogVerbosity is to control the verbosity level of logging displayed in the in-game console. It allows developers to filter the amount of log information shown, balancing between visibility of important messages and avoiding excessive spam or performance impact.

This setting variable is primarily used by the Core and Engine modules of Unreal Engine, specifically in the logging and console output systems. It’s referenced in the ConsoleManager, EngineUtils, and Console components.

The value of this variable is set as a console variable (CVar) with a default value of 0. It can be modified at runtime through the console or programmatically.

Con.MinLogVerbosity interacts with the Verbosity level of log messages. When a log message is processed, its Verbosity is compared against the MinLogVerbosity value to determine if it should be displayed in the console.

Developers should be aware that:

  1. Setting this value too low (0) will hide most log messages, which might make debugging difficult.
  2. Setting it too high might flood the console with excessive information, potentially impacting performance.
  3. The value corresponds to different levels of message importance: 0 (no logging), 1 (fatal errors), 2 (errors), 3 (warnings), and so on.

Best practices when using this variable include:

  1. Use a value of 2 or 3 during development to catch important errors and warnings.
  2. Lower the value for release builds to minimize performance impact.
  3. Temporarily increase the value when debugging specific issues that require more detailed logging.
  4. Consider the performance implications when setting this value, especially on lower-end hardware or in performance-critical scenarios.

#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:3770

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarMinLogVerbosity(
	TEXT("con.MinLogVerbosity"),
	0,
	TEXT("Allows to see the log in the in game console (by default deactivated to avoid spam and minor performance loss).\n"
		 " 0: no logging other than console response (default)\n"
		 " 1: Only fatal errors (no that useful)\n"
		 " 2: additionally errors\n"
		 " 3: additionally warnings\n"

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/EngineUtils.cpp:559

Scope (from outer to inner):

file
function     void FConsoleOutputDevice::Serialize

Source code excerpt:

		bool bLogToConsole = true;

		static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("con.MinLogVerbosity"));

		if(CVar)
		{
			int MinVerbosity = CVar->GetValueOnAnyThread(true);

			if((int)Verbosity <= MinVerbosity)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UserInterface/Console.cpp:1784

Scope (from outer to inner):

file
function     void UConsole::Serialize

Source code excerpt:

	else
	{
		static const TConsoleVariableData<int32>* CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("con.MinLogVerbosity"));

		if (CVar)
		{
			int MinVerbosity = CVar->GetValueOnAnyThread();

			if ((int)Verbosity <= MinVerbosity)