Skip to content

Instantly share code, notes, and snippets.

@zachwlewis
Last active May 21, 2020 14:05
Show Gist options
  • Save zachwlewis/cf7543882a74ef61e9a77d931874aa4b to your computer and use it in GitHub Desktop.
Save zachwlewis/cf7543882a74ef61e9a77d931874aa4b to your computer and use it in GitHub Desktop.
UE4 Reference Sheet

Logging

Creating a log category

To create a new log category, first declare a log category in a header file.

// ClassName.h

DECLARE_LOG_CATEGORY_EXTERN(LogCategoryName, Log, All);

Second, define the category in an implementation file.

// ClassName.cpp

DEFINE_LOG_CATEGORY(LogCategoryName);

Adding a log message

Use the UE_LOG macro to print a log to the output window (editor) or to the log (game).

UE_LOG(LogCategoryName, Log|Error|Warning, TEXT("Log text."));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment