All of my custom Debug logs are not allowing me to compile my code

I was having the same issue in regard to the above and the compiler didn’t like the code until the custom logs were being implemented somewhere. Intellisense doesn’t like it and it throws a red.

In the game.h:

DECLARE_LOG_CATEGORY_EXTERN(YourLog, Verbose, All);

In the game.cpp:

DEFINE_LOG_CATEGORY(YourLog);

Implementation in my character.cpp. Include the game.h:

UE_LOG(YourLog, Warning, TEXT("YourLog Warning"));

It runs and allows all variations of the custom debug message e.g. Verbose, Very Verbose etc.

Hope this helps.

2 Likes