UE_LOG no longer outputs messages in unreal

I’ve been following through Lecture 88 until right at the end where he hits play to check that things are still functioning as they had before (13:00), but for whatever reason, I’m not getting any of my ue_logs coming out in Unreal’s Output Log to see whether my line trace, or grab and release are actually working.

I’ve gone through line for line with Ben’s github .h and .cpp files and the only thing that is different are the #include files, as I’m on the IWYU version. I feel like I’ve either messed these up or I’m missing an include in the .h file? I’m getting no errors when I compile/ build on VS or Unreal.

These are my includes:

Header

Up until this my code was working fine… help!

Make sure the output log Filters have everything checked, or at minimum, Warning and Error severity, and the LogTemp category.

The log macros are in Logging/LogMacros.h, which is included by CoreMinimal.h, so it would be very odd that they’re missing, and I’d expect to see a ton of compiler errors if they were.

I checked the log filters in the Unreal Editor last night and everything was selected, but I will double check later today.

Is there a chance that I need to add ‘CoreMinimal.h’ to the CPP file as well? Or another include to the Header file such as ‘Components/InputComponent.h’ since I am now putting the line trace function in the privates section of my header file?

Thanks for the response!

Generally speaking, your best practice is to put all the #include statements in the .h file, and then only include that in your .cpp file. I’d read that it’s a good idea to not put any new includes after the .generated.h file, but I can’t find that right now.

You’re including CoreMinimal.h in the header file, and then including that in the .cpp, so there’s no need to add it again. As an aside, the way #include works is by literally inserting the contents of the file in place of the #include statement.

As far as the overall issue, this doesn’t smell like an include file problem to me. I’d go back and walk through both the code and configuration (Are your action mappings still in place?). Follow the path of execution and verify that all the steps needed to get to your log statement are able to execute.

Good luck! I’ve run into issues like this before in my own code. It can be frustrating!

OK, I’ll have another look this evening and see. I know when I usually put any includes in my header file I get a whole pile of problems with my macros, but from what I’ve read they go away after some time?

Thanks

So I have gone through everything again here to the best of my knowledge and I can’t find something that looks out of place. I have put all my #includes into my .h file, but still no UE_LOGs in the output log.

I’ve done a bit more playing around and have noticed that I only get UE_LOGs when I place them directly in the begin play() function:

Capture

I don’t see them anywhere outside of placing them here.

So I grabbed an earlier commit and just repeated the section and now its working as it should. Still do not know what was wrong in the first place so I’ll leave the discussion open if anyone would like to speculate for now. Would love to know why it might not have been logging.

Have you added any #include directives in your grabber.h header file?

Yep, they were all in the header file. Only include in the cpp was the header include.

I’m sorry, I missed that you’d added the #includes to your .h file.

Does the GENERATED_BODY() line also have the red squiggly line? And what version of URE4 are you using?

In later versions, than 4.16 I believe, EPIC has gone to a new engine source code structure called include-what-you-use IWYU. If you’re already aware of this then the rest of my response may be of no use.

Adding #includes to .h file of your class can cause similar issues. It’s not really the #include that causes the issue, it’s really a result of moving the UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) down in your .h file. If you have room in above that line you can delete a blank line to get it back on the proper line. or you can go through the Project Reset procedure outlined in Lecture 84: Resetting Your Unreal Project. Doing the reset regenerates the .generated.h files. These files reference specific line numbers in your class’ .h file.

I like to have all of my additional includes in the .h file of the class. When I first create a class I immediately go into the .h file and add a number of empty lines to the top, in anticipation of adding #include directives. Then
I reset the project. That gives me space to just drop any new #include directives in without causing issues.

Hope some of this helps.

Yeah I’ve noticed that you can just let VS sit for like 10 - 15 mins and it will figure itself out eventually haha

I solved the problem by literally just re doing the section. There might have been something with the order in which I added and moved things around that messed with it. This time I just followed exactly step for step what Ben did and it seemed to work, even though I’m 99% sure my old version looked the same as his when I had this issue. Something about it wasn’t letting my logs get to Unreal.

1 Like

Awesome! Glad you worked it out.

Yeah, VS has it’s own strange behaviors. But adding in the URE4 macro weirdness creates a whole new level of “what the heck just happened to my code”. lol…

Privacy & Terms