October 07, 2017 by PhroZen

An improved UE_LOG

We are currently rewriting our game from Unreals Blueprint to C++ and as always there is need to logging. And while the standard log framework provides the UE_LOG macro it is somewhat lackluster. One of us (Frodenkvist to be precise) was annoyed enough by it to do something about it.

This little script is a drop in replacement for the UE_LOG but it provides some more needed info. This will only work on windows at the moment.

Just add it to your <projectname>.h file and use VALHALLA_LOG instead of UE_LOG.

The following code:

UE_LOG(LogTemp, Error, TEXT("Old style of log")) VALHALLA_LOG(LogTemp, Error, TEXT("New style of log"))

Will output the following in the log:

LogTemp: Error: Old style of log LogTemp: Error: AValhallaBasePlayerController::OpenCharacterMenu(179) Client 1: New style of log

The extra stuff that is displayed is class, method, row number and if the log came from a client or server. Neat huh!