To allow a unified way for logging facilitating, e.g., debugging, please always use the Universal Logging plugin.
We provide predefined logging streams that you should use:
In every cpp class you have to #include "Helper/CharacterPluginLogging.h"
Then you can use streams for which macros are provided
Stream | description |
---|---|
VH_LOG | used for general logging, which might be of interest for a user |
VH_WARN | a warning, which should be fixed by the user (will be logged on screen in yellow) |
VH_ERROR | an error, which is about to break the software (will be logged on screen in red) |
VH_DEBUG | temporarily use for debugging your code (will be logged on screen in green) |
You can use the normal Unreal printf syntax to log variables etc., e.g.:
int AUNumber=42;
VH_WARN("Cannot activate AU %d\n", AUNumber);
GetOwner()
, otherwise use UniLog.LogF(LogName, "Message %s", ...)
directly, where LogName is "VHLog"
, "VHWarn"
, "VHError"
or "VHDebug"
. Or UniLog.Log("Message %s", LogName)
if you do not want to print a variable.
Everything will be logged into ..\Saved\Logs\UniversalLogging.log
and also the default Unreal log
|
---|