Struct NetDebug
Singleton handling NetCode logging and log management.
Implements
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public struct NetDebug : IComponentData, IQueryTypeParameter
Properties
LogLevel
The current debug logging level. Default value is Notify.
Declaration
[ExcludeFromBurstCompatTesting("may use managed objects")]
public NetDebug.LogLevelType LogLevel { get; set; }
Property Value
Type | Description |
---|---|
NetDebug.LogLevelType |
MaxRpcAgeFrames
A NetCode RPC will trigger a warning if it hasn't been consumed or destroyed (which is a proxy for 'handled') after this many simulation frames (inclusive). Age. Set to 0 to opt out.
Declaration
public ushort MaxRpcAgeFrames { readonly get; set; }
Property Value
Type | Description |
---|---|
ushort |
SuppressApplicationRunInBackgroundWarning
If you disable runInBackground, users will experience client disconnects
when tabbing out of (or otherwise un-focusing) your game application.
It is therefore highly recommended to enable "Run in "Background" via ticking Project Settings... Player... Resolution and Presentation... Run In Background
.
Declaration
public bool SuppressApplicationRunInBackgroundWarning { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Setting SuppressApplicationRunInBackgroundWarning to true will allow you to toggle off "Run in Background" without triggering the advice log.
SuppressApprovalRpcSentWhenApprovalFlowDisabledWarning
When debugging, it's helpful to treat 'sending an IApprovalRpcCommand RPC when approval is disabled' as a warning. However, you may use approval RPCs to also send match join information, thus you may wish to suppress this warning. Do so by setting this to true. This log suppression is enabled by default! Set this flag to false to see the warning.
Declaration
public bool SuppressApprovalRpcSentWhenApprovalFlowDisabledWarning { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
DebugLog(in FixedString512Bytes)
Print the log message with Debug level priority;
Declaration
public readonly void DebugLog(in FixedString512Bytes msg)
Parameters
Type | Name | Description |
---|---|---|
FixedString512Bytes | msg | The ascii message string. Unicode are not supported |
Dispose()
Destroy the internal resources allocated by the debug logger and flush any pending messages.
Declaration
public void Dispose()
Log(in FixedString512Bytes)
Print a log message with Notify level priority;
Declaration
public readonly void Log(in FixedString512Bytes msg)
Parameters
Type | Name | Description |
---|---|---|
FixedString512Bytes | msg | The ascii message string. Unicode are not supported |
LogError(in FixedString512Bytes)
Print a log message with error priority
Declaration
public readonly void LogError(in FixedString512Bytes msg)
Parameters
Type | Name | Description |
---|---|---|
FixedString512Bytes | msg | The ascii message string. Unicode are not supported |
LogFolderForPlatform()
Use this method to retrieve the platform specific folder where the NetCode logs files will be stored. On Desktop it use the consoleLogPath is used. For mobile, the persistentDataPath is used. For DOTS Runtime builds, it is possible to customise the output by using the -logfile command line switch.
In all cases, if the log path is null or empty, the Logs folder in the current directory is used instead.
Declaration
public static string LogFolderForPlatform()
Returns
Type | Description |
---|---|
string | A string containg the log folder full path |
LogWarning(in FixedString512Bytes)
Print a log message with warning priority
Declaration
public readonly void LogWarning(in FixedString512Bytes msg)
Parameters
Type | Name | Description |
---|---|---|
FixedString512Bytes | msg | The ascii message string. Unicode are not supported |
PrintHex(uint)
Print an unsigned integer in hexadecimal format
Declaration
public static FixedString32Bytes PrintHex(uint value)
Parameters
Type | Name | Description |
---|---|---|
uint | value | The unsigned value to convert |
Returns
Type | Description |
---|---|
FixedString32Bytes |
PrintHex(ulong)
Print a unsigned long integer in hexadecimal format
Declaration
public static FixedString32Bytes PrintHex(ulong value)
Parameters
Type | Name | Description |
---|---|---|
ulong | value | The unsigned value to convert |
Returns
Type | Description |
---|---|
FixedString32Bytes |