|This article is a preliminary version, it is subject to change.|
The Message Log is a way to display logs to the user in editor and in the output log at the same time. The messages display in the Message Log can react to user interaction by integrating Links to Objects, Blueprints, Assets and more. These messages are displayed in the "Message Log" window available at Window > Developer Tool > Message Log and are organized in multiples categories. Useful for artists and Level designer to have quick feedback on the level configuration.
|For Output Log logging with UE_LOG see Logging|
This articles describe the way to use the Message Log system in order to display messages to the user in the editor.
Terms and Structure
Messages could be included in a Page. After the declaration of a page, each following messages are included in it. Most of the time, a new pages means a cleaning of old messages and a starts of a new sequence of messages.
These messages and pages are displayed in the Message Log window in Log Listings.
Each listing is associated with a log category and are declared with the
A listing can be configured to allow page selection, clearing, message filtering and more.
Logging with Message Log
In this section, you will discover how to use the Message Log in your code to display rich messages in the editor's Message Log window.
To keep this section focused on logging we will make use of
FText::FromString() but you must use
LOCTEXT() in a production project.
All messages must be created from an instance of
This instance is created by giving the contructor a single
FName containing the log category where you want to send your log message.
// You need the following include at the beginning of the file // Logging/MessageLog.h contains the declaration of FMessageLog #include "Logging/MessageLog.h" //... // All messages created with this instance will be flushed to the "Play in Editor" log category listing in the Message Log window FMessageLog PIELogger = FMessageLog(FName("PIE"));
See "Editor Log Categories" for a full list of the available log categories or "Log Listing creation" to create your own listing
Now, you can send your messages to this category using the
CriticalError() methods depending of the severity if the message.
All these methods only takes a single
FText containing the content of the message to display.
CriticalError() method is used for fatal errors and will crash your editor/game if used.
Use it in case you can't allow your game to run with this error occured.
PIELogger.Info(FText::FromString("Informationnal message")); PIELogger.Warning(FText::FromString("Warning message")); PIELogger.PerformanceWarning(FText::FromString("Warning message about performace issue")); PIELogger.Error(FText::FromString("Error message"));
You can also use the
Message() method and specify the severity of it with the
PIELogger.Message(EMessageSeverity::Type::Warning, FText::FromString("Enum defined Warning message"));
Messages are stored inside the
FMessageLog but not flushed to the Message Log system before the instance destruction.
You must destroy the instance to send all messages declared with it.
It isn't recomanded to keep an instance of
FMessageLog too long, keep it simple, just create a new instance in the current scope when you need to log something ant let it be destroyed at the end of the scope.
For an easy and unified access to your logger, you can create a single header file named like
#pragma once #include "Logging/MessageLog.h" #define MY_AWESOME_LOGGER_LOGNAME FName("LogCategory") #define MY_AWESOME_LOGGER FMessageLog(MY_AWESOME_LOGGER_LOGNAME)
Now, you just have to call
Of course, don't forget to include your
|Explain how to do a tokenized logging using FTokenizedMessage|
Log Listing creation
|This section assumes that you know what is a Game Module and already have one configured with a module class.|
|Explain how to create a custom Log Listing with FMessageLogModule|
Editor Log Categories
Below, the list of all Unreal Engine defined log categories and their associated listings in the editor window.
|Log Category||Log Listing Label||Notes|
||Automation Testing Log|
||Anim Blueprint Log|
||UDN Parse Errors||Not shown in the Message Log window|
||Build and Submit Errors|
||Lighting Results||A new page is created before and after each new lightning build|
||Slate Style Log|
||Play In Editor||A new page is created before each Play in Editor session|
||Compiler Log||A new page is created before each compilation|
||BlueprintCompiler||A new category can be created for each blueprint compilation|
Not shown in the Message Log window
This table was created based on a search of
.RegisterLogListing( in the editor's source code.
Last update 10th June 2020.