Struct NetDebug
Singleton handling NetCode logging and log management.
Inherited Members
Namespace: Unity.NetCode
Syntax
public struct NetDebug : IComponentData, IQueryTypeParameter
Properties
LogLevel
The current debug logging level. Default value is Notify.
Declaration
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).
Declaration
public ushort MaxRpcAgeFrames { get; set; }
Property Value
| Type | Description |
|---|---|
| UInt16 |
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(UInt32)
Print an unsigned integer in hexadecimal format
Declaration
public static FixedString32Bytes PrintHex(uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | value | The unsigned value to convert |
Returns
| Type | Description |
|---|---|
| FixedString32Bytes |
PrintHex(UInt64)
Print a unsigned long integer in hexadecimal format
Declaration
public static FixedString32Bytes PrintHex(ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt64 | value | The unsigned value to convert |
Returns
| Type | Description |
|---|---|
| FixedString32Bytes |