[UE4]UE_LOG的用法和枚举类型

示例:

const TCHAR* path = TEXT("/Resource/test.ini");
TArray<FString> sectionNames;
GConfig->GetSectionNames(path, sectionNames);
for (int i = 0; i < sectionNames.Num(); i++)
{
	const TCHAR* msg = sectionNames[i].GetCharArray().GetData();
	UE_LOG(LogTemp, Display, TEXT("%s"), *msg);
}

UE_LOG的枚举类型

OutputDevice.h

enum Type
	{
		/** Not used */
		NoLogging		= 0,

		/** Always prints s fatal error to console (and log file) and crashes (even if logging is disabled) */
		Fatal,

		/** 
		 * Prints an error to console (and log file). 
		 * Commandlets and the editor collect and report errors. Error messages result in commandlet failure.
		 */
		Error,

		/** 
		 * Prints a warning to console (and log file).
		 * Commandlets and the editor collect and report warnings. Warnings can be treated as an error.
		 */
		Warning,

		/** Prints a message to console (and log file) */
		Display,

		/** Prints a message to a log file (does not print to console) */
		Log,

		/** 
		 * Prints a verbose message to a log file (if Verbose logging is enabled for the given category, 
		 * usually used for detailed logging) 
		 */
		Verbose,

		/** 
		 * Prints a verbose message to a log file (if VeryVerbose logging is enabled, 
		 * usually used for detailed logging that would otherwise spam output) 
		 */
		VeryVerbose,

		// Log masks and special Enum values

		All				= VeryVerbose,
		NumVerbosity,
		VerbosityMask	= 0xf,
		SetColor		= 0x40, // not actually a verbosity, used to set the color of an output device 
		BreakOnLog		= 0x80
	};

猜你喜欢

转载自aigo.iteye.com/blog/2278052