You can log to the Text Window with the
UE_VLOG macro. The Text Window displays information on a per-frame bases, so only text logged in the current frame will show up as you scrub through the recorded data. You can log text from anywhere, and the
UE_VLOG macro will cleanly remove itself from compilation in builds that don't support the Visual Logging system, so it is safe to use without checking the
ENABLE_VISUAL_LOG macro. The macro takes parameters indicating the Actor associated with the text, the log category and verbosity level (used for filtering the display), and the text itself.
In the following sample code, our customized Character uses
UE_VLOG to log information after firing a projectile:
// Try to fire a projectile
if (ProjectileClass != NULL)
// Collect our aim rotation.
const FRotator SpawnRotation = GetControlRotation();
// MuzzleOffset is in camera space, so transform it to world space before offsetting from the character location to find the final muzzle position.
const FVector SpawnLocation = GetActorLocation() + SpawnRotation.RotateVector(GunOffset);
UWorld* const World = GetWorld();
if (World != NULL)
// Spawn the projectile into the world at the muzzle's location.
World->SpawnActor<AGDCProjectile>(ProjectileClass, SpawnLocation, SpawnRotation);
// Log this event with the Visual Logger.
UE_VLOG(this, LogFPChar, Verbose, TEXT("Fired projectile (%s) from location (%s) with rotation (%s)"),
Visual Logger showing debug text from our
If you want to send a duplicate message to the standard log, you can use the
UE_VLOG_UELOG macro instead of calling
UE_VLOG followed by
UE_LOG with the same data.