Add NetworkReplicator::EnableLog to optionally enable verbose logging of networking
This commit is contained in:
@@ -29,12 +29,10 @@
|
|||||||
#include "Engine/Threading/Threading.h"
|
#include "Engine/Threading/Threading.h"
|
||||||
#include "Engine/Threading/ThreadLocal.h"
|
#include "Engine/Threading/ThreadLocal.h"
|
||||||
|
|
||||||
// Enables verbose logging for Network Replicator actions (dev-only)
|
#if !BUILD_RELEASE
|
||||||
#define NETWORK_REPLICATOR_DEBUG_LOG 0
|
bool NetworkReplicator::EnableLog = false;
|
||||||
|
|
||||||
#if NETWORK_REPLICATOR_DEBUG_LOG
|
|
||||||
#include "Engine/Core/Log.h"
|
#include "Engine/Core/Log.h"
|
||||||
#define NETWORK_REPLICATOR_LOG(messageType, format, ...) LOG(messageType, format, ##__VA_ARGS__)
|
#define NETWORK_REPLICATOR_LOG(messageType, format, ...) if (NetworkReplicator::EnableLog) { LOG(messageType, format, ##__VA_ARGS__); }
|
||||||
#else
|
#else
|
||||||
#define NETWORK_REPLICATOR_LOG(messageType, format, ...)
|
#define NETWORK_REPLICATOR_LOG(messageType, format, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -34,6 +34,13 @@ API_CLASS(static, Namespace = "FlaxEngine.Networking") class FLAXENGINE_API Netw
|
|||||||
typedef void (*SerializeFunc)(void* instance, NetworkStream* stream, void* tag);
|
typedef void (*SerializeFunc)(void* instance, NetworkStream* stream, void* tag);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
#if !BUILD_RELEASE
|
||||||
|
/// <summary>
|
||||||
|
/// Enables verbose logging of the networking runtime. Can be used to debug problems of missing RPC invoke or object replication issues.
|
||||||
|
/// </summary>
|
||||||
|
API_FIELD() static bool EnableLog;
|
||||||
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the network replication serializer for a given type.
|
/// Adds the network replication serializer for a given type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user