UE_LOG

使用方式

1
UE_LOG(YourLogName, Warning, TEXT("Problem on load Province Message!"));

DECLARE_LOG_CATEGORY_EXTERN 声明自定义的 Log 标签

在.h 文件中,填写如下代码:

1
DECLARE_LOG_CATEGORY_EXTERN(YourLogName, Log, All);

在.cpp 文件中,填写如下代码:

1
DEFINE_LOG_CATEGORY(YourLogName);

输出格式如下:

(1)UE_LOG(YourLogName, Warning, TEXT("Problem on load Province Message!"));

(2)UE_LOG(YourLogName, Warning, TEXT("Content:%s"), *(Response->GetContentAsString()));

颜色设置

1
2
3
4
5
6
//"this is Grey Text"
UE_LOG(YourLog, Log, TEXT("This is grey text!"));
//"this is Yellow Text"
UE_LOG(YourLog, Warning, TEXT("This is yellow text!"));
//"This is Red Text"
UE_LOG(YourLog, Error, TEXT("This is red text!"));