FScopedLog

Use this following code snippet, to execute the above function.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

NetcodeUnitTest

Header

/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Public/NUTUtilDebug.h

Include

#include "NUTUtilDebug.h"

Syntax

class FScopedLog

Remarks

A class for enabling verbose log message categories, within a particular code scope (disabled when going out of scope). NOTE: If you are logging any kind of net-related log messages, specify a unit test (even if you aren't doing remote logging)

Also supports remote (server) logging, for net functions executed within the current code scope (causes net packets to be flushed both upon entering the current scope, and when exiting it - required for correct log timing).

NOTE: If you are trying to catch remote log messages deep within the internal game netcode, then this class may not be appropriate, as remote logging passes through the netcode (YMMV)

Variables

Name Description

Protected variable

bool

 

bRemoteLogging

Whether or not this is also controlling remote logging as well

Protected variable

bool

 

bSuppressLogging

Whether or not to suppress instead of enable logging

Protected variable

TArray< FString...

 

LogCategories

The list of unsuppressed log messages

Protected variable

UClientUnitTest...

 

UnitTest

Stores a reference to the unit test doing the logging, if specified

Constructors

Name Description

Protected function

FScopedLog()

Public function

FScopedLog

(
    const TArray< FString >& InLogCate...,
    UClientUnitTest* InUnitTest,
    bool bInRemoteLogging
)

Constructor used for setting up the type of logging that is done.

Public function

FScopedLog

(
    const FString InLogCategory,
    UClientUnitTest* InUnitTest,
    bool bInRemoteLogging
)

As above, but for a single log category.

Destructors

Name Description

Public function

~FScopedLog()

Functions

Name Description

Protected function

void

 

InternalConstruct

(
    const TArray< FString >& InLogCate...,
    UClientUnitTest* InUnitTest,
    bool bInRemoteLogging
)

FScopedLog

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss