Clear output log?

The output log window seems to be very inefficient in displaying its data. Right now mine apparently has too much in it and just trying to view it causes the editor to freeze for several seconds. As long as it is displayed the frame rate makes the editor unusable.

Is there a way to clear its data without restarting?

1 Like

I just want to add that my output log is always open and stays so for hours on end with tons of information and I haven’t noticed any performance issues. Curious what are your hardware specs?

I’ve had issues with blueprint spewing thousands of lines per second into my log (Wire trace not injected before jump? - Blueprint - Epic Developer Community Forums), so I think that I probably have more entries than you :slight_smile:

That said, I have found in general that Slate will spend inordinate amounts of render cycle time in drawing large amounts of data. It might be the GPUs we have in the studio, since unfortunately the machines are built for VFX software which as strange as it sounds is almost at odds with a game engine, since they tend to use workstation class cards instead of gaming cards. The machines are quite strong except for that.

Intel Xeon E5-1650v2 @3.5ghz (12 cores)
64GB RAM
NVidia Quadro K4000
Windows 7x64

> thousands of lines per second into my log

Ah, ok then :slight_smile:

You can right click -> Clear log.

17 Likes

Well don’t I feel like the idiot now. I swear I had looked there first! Guess I just didn’t see it :frowning:

Got it now though so thanks!

3 Likes

does anybody know if we can clear log automatically at each time level is played ? couldnt find any suitable command to execute at Begin Play.

I honestly don’t know, but if I had to guess, it would have something to do with the “con.MinLogVerbosity” command.

Anyone know how to access this “Clear log” through c++ or console?

I tracked back to a class called “SOutputLog” but don’t think I can work anything out from there.
Two things I’d like to achieve.

  1. Clear Log when I hit Play (“Clear Log” on BeginPlay)
  2. Clear Log whenever I press alt+ctrl+c
    I always use this shortcut combination in my past game engines and Unity projects and I’d like do the same for Unreal.

Anyone from Unreal dev team on the forum?

This ever get fixed? I could see a use for it just to keep things clean.

Was this ever fixed? I would really love to have my output log cleared automatically because it is really inefficient and makes debugging in the editor nearly impossible sometimes.

Necro because this is the first thing to pop up on google for this question.

–>** To automatically clear on play : on the output log window, bottom right > View options > Clear on PIE (Play in editor)**

7 Likes

Yes this “works” until something new is entered then all the old cleared out data is back. Kind of annoying, actually.

I was interested in clearing the log with c++. it seems that is not possible at the moment.

You only have access to the very lacklustre interface of FOutputLogModule which doesnt offer any functionally to clear the log in the first place. However, you can get access to the underlying SWidget (SOutputLog) which does exactly this. But it is not exported and thus it gives linking errors.
The only way to achieve this would making a carbon copy of the SOutputLog class and cast it to this. But that is hackery.

Seems epic would need to change some things on their end first.

Hi, I have a question.
What are you printing in this output log. Are you spamming messages via tick? Do you have tons of functionality that log a message? Have you tried other debuging options that don’t require the output log?

I’m asking because once you package your game, log messages aren’t usually shown. Having tons of log messages causes lots of latency in the game/project which is never good. I’m also asking because I know of some good ways to debug without spamming the output so if your doing something different then maybe there is no alternative.

Thanks for your time.

I know this thread is a bit old, but I’ve figured out a way to clear the output log using C++, it requires some setup though…

in "YourProjectName"Editor.Target.cs file, add “OutputLog” module to public and private dependency names as follows:

.
.
.
		PublicDependencyModuleNames.AddRange(new string[]
		{
			"OutputLog",
		});
		
		PrivateDependencyModuleNames.AddRange(new string[]
		{
			"OutputLog",
		});
.
.
.

Declare a static function in a blueprint function library…

UMyBlueprintFunctionLibrary.h

UCLASS()
class YourProjectName_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

	UFUNCTION(BlueprintCallable)
	static void ClearOutputLog();
}

Now, in the respective .cpp file, it’s important to add the following dependencies:
(otherwise, the UBT will throw linking errors)

#include "OutputLog/Public/OutputLogModule.h"
#include "Developer/OutputLog/Private/SOutputLog.h"
#include "Developer/OutputLog/Private/SOutputLog.cpp"
#include "Developer/OutputLog/Private/OutputLogStyle.h"
#include "Developer/OutputLog/Private/OutputLogStyle.cpp"

Next, implement the static function as follows:

void UMyBlueprintFunctionLibrary::ClearOutputLog()
{
	// Check if the module is loaded before accessing it...
	if (FModuleManager::Get().IsModuleLoaded("OutputLog"))
	{
		const FOutputLogModule& OutputLogModule = FModuleManager::GetModuleChecked< FOutputLogModule >(TEXT("OutputLog"));
		
		// Cast the underlying slate of OutputLogModule to SOutputLog...
		if (const auto OutputLog = StaticCastSharedPtr<SOutputLog>(OutputLogModule.GetOutputLog()); OutputLog.IsValid())
		{
			// Clear the output log...
			if (OutputLog->CanClearLog())
			{
				OutputLog->OnClearLog();
			}
		}
	}
}

That’s all.

You could then call this function in your code or blueprints whenever you want the OutputLog to be cleared.

I hope this helps :slight_smile:

2 Likes

I get linker errors when including the .cpp files and when including the header files only I get an error saying onclearlog and canclearlog are missing external references. how can I fix this and thanks in advance