Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 LogTemp and Warning not autocomplete in UE
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jorge24
Junior Member

USA
23 Posts

Posted - Jun 25 2020 :  02:20:23 AM  Show Profile  Reply with Quote
In Unreal Engine, Epic's preferred way to print out logs to the UE console is to use:

UE_LOG(LogTemp, Warning, TEXT("text to print"));


However, Visual Assist does not autocomplete the log category like "LogTemp" nor verbosiy like "Warning".







It does autocomplete other log verbosities like "Display" and "Error" such as
UE_LOG(LogTemp, Error, TEXT("text to print"));


On the other hand, Visual Studio's intellisense is able to autocomplete LogTemp.

I have tried this using the Unreal Engine 4.25.1 installed from the Epic Launcher.

As I was writing this post I learned to use the VA snippet feature and realized I can use it to pop up an entire log template which makes things easier and faster than typing each word with autocomplete. So, this missing autocomplete here is not really an issue anymore. Still, I decided to post this since I had already started typing it.

feline
Whole Tomato Software

United Kingdom
16732 Posts

Posted - Jun 26 2020 :  07:19:56 AM  Show Profile  Reply with Quote
As a temporary work around, can you please go to VA options and press the button:

VA Options -> Performance -> Rebuild symbol databases

and now close all open instances of Visual Studio.

Before reloading Visual Studio, and letting VA start rebuilding its symbol database please go to the root directory of your Unreal Engine solution, where the .SLN file lives. In this directory create a new text file called:

va_stdafx.h

and edit this file, giving it the content:

#define DEFINE_LOG_CATEGORY(LOG_CATEGORY) enum { LOG_CATEGORY };

making sure the file ends with a blank line, and saving it out. VA automatically looks for this file next to the SLN file, and if found, parses it before it starts parsing anything else for this solution.

This should tell VA how to understand all of the log types that are being defined, but not currently known. Unfortunately it does require a VA symbol database rebuild to take effect, which will take several minutes since VA has to parse all of Unreal Engine, plus your game solution as well.

Since this file is not part of the solution, and it is something that VA looks for directly, it is safe to check it into source control.

Does this fix the problem for you?

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16732 Posts

Posted - Jun 26 2020 :  11:33:06 AM  Show Profile  Reply with Quote
I think I know why the second parameter is not being suggested by VA, but I am not sure what to do about this. It looks like these logging flags are set in the file "LogVerbosity.h"

\Engine\Source\Runtime\Core\Public\Logging\LogVerbosity.h

which has, in summary:

namespace ELogVerbosity
{
    enum Type : uint8
    {
		Error,
		Warning, // the rest
    };
}

so, when typing "Warning" in the UE_LOG macro call, this does not appear to be in scope. I assume it is in scope, but I have not yet found the using namespace line, or equivalent, that makes this happen.

Simply adding these enum items as global Unreal Engine symbols should solve your problem, but do we want to do this?

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16732 Posts

Posted - Jul 01 2020 :  09:58:56 AM  Show Profile  Reply with Quote
As a work around, can you please try adding the following code to your "va_stdafx.h" file:

#define DEFINE_LOG_CATEGORY(LOG_CATEGORY) enum { LOG_CATEGORY };
enum UE_LOG_TYPE { NoLogging = 0, Fatal, Error, Warning, Display, Log, Verbose, VeryVerbose, All, NumVerbosity, VerbosityMask, SetColor, BreakOnLog };
void UE_LOG(int CatgeoryName, UE_LOG_TYPE Verbosity, TCHAR *Format, ...);
void UE_CLOG(int Condition, int CatgeoryName, UE_LOG_TYPE Verbosity, TCHAR *Format, ...);

making sure that the file ends with a blank line. After a VA symbol database rebuild this should help with VA understanding and suggesting the second parameter.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16732 Posts

Posted - Jul 01 2020 :  10:53:30 AM  Show Profile  Reply with Quote
case=117086

zen is the art of being at one with the two'ness
Go to Top of Page

Jorge24
Junior Member

USA
23 Posts

Posted - Jul 10 2020 :  03:48:13 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

As a work around, can you please try adding the following code to your "va_stdafx.h" file:

#define DEFINE_LOG_CATEGORY(LOG_CATEGORY) enum { LOG_CATEGORY };
enum UE_LOG_TYPE { NoLogging = 0, Fatal, Error, Warning, Display, Log, Verbose, VeryVerbose, All, NumVerbosity, VerbosityMask, SetColor, BreakOnLog };
void UE_LOG(int CatgeoryName, UE_LOG_TYPE Verbosity, TCHAR *Format, ...);
void UE_CLOG(int Condition, int CatgeoryName, UE_LOG_TYPE Verbosity, TCHAR *Format, ...);

making sure that the file ends with a blank line. After a VA symbol database rebuild this should help with VA understanding and suggesting the second parameter.



Hi, thanks for the workaround. I tried that and it fixed one of the two. Now I get autocomplete for the verbosity like Warning/Display/Error but I still don't get autocomplete for the log category like "LogTemp"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000