Class DebugUtilities
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Utilities
Assembly: cs.temp.dll.dll
Syntax
public static class DebugUtilities
Fields
LogLevel
This helper defaults to showing all messages of information and above (i.e. including warnings and errors)
Declaration
public static DebugUtilities.LoggingLevel LogLevel
Field Value
Type | Description |
---|---|
DebugUtilities.LoggingLevel |
Methods
DebugAssert(Boolean)
Asserts a condition.
Declaration
public static void DebugAssert(bool condition)
Parameters
Type | Name | Description |
---|---|---|
Boolean | condition | The condition that is expected to be true. |
DebugAssert(Boolean, String)
Asserts a condition.
Declaration
public static void DebugAssert(bool condition, string message)
Parameters
Type | Name | Description |
---|---|---|
Boolean | condition | The condition that is expected to be true. |
String | message | The message to display if the condition evaluates to false. |
DebugLog(String)
Logs a message.
Declaration
[Obsolete("Deprecated. Use Log instead.")]
public static void DebugLog(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message | The message to log. |
DebugLogError(String)
Logs an error message.
Declaration
[Obsolete("Deprecated. Use LogError instead.")]
public static void DebugLogError(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message | The message to log. |
DebugLogWarning(String)
Logs a warning message.
Declaration
[Obsolete("Deprecated. Use LogWarning instead.")]
public static void DebugLogWarning(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message | The message to log. |
DrawBounds(Bounds, Color, Color)
Draws the minimum and maximum points of the given bounds
Declaration
public static void DrawBounds(Bounds bounds, Color minColor, Color maxColor)
Parameters
Type | Name | Description |
---|---|---|
Bounds | bounds | |
Color | minColor | |
Color | maxColor |
DrawPoint(Vector3, Color, Single)
Draws a point in the Scene window.
Declaration
public static void DrawPoint(Vector3 point, Color color, float size = 0.05F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | |
Color | color | |
Single | size |
DrawPoint(Vector3, Quaternion, Color, Single)
Draws a point with a rotation in the Scene window.
Declaration
public static void DrawPoint(Vector3 point, Quaternion rotation, Color color, float size = 0.05F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | |
Quaternion | rotation | |
Color | color | |
Single | size |
Log(String)
Logs a message at the informational level.
Declaration
public static void Log(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message | The message to log. |
LogError(String)
Logs an error message.
Declaration
public static void LogError(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message | The message to log. |
LogVerbose(String)
Logs the given message to the Unity console and player log if verbose logging is enabled.
Declaration
public static void LogVerbose(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message |
Remarks
If you are doing string concatentation or manipulation, use LogVerboseFormat that formats the string, as that will not allocate memory when verbose logging is enabled.
For example, don't do: Debug.LogVerbose("This is my message: " + text);
Do: Debug.LogVerbose("This is my message: {0}", text);
Note that verbose logs do not include the callstack to reduce the noise in the generated editor log. Even with default stack trace parameter (StackTraceLogType.ScriptOnly), the editor logs will grow significantly (i.e. a 10x+ line growth factor).
LogVerboseFormat(String, Object[])
Formats and logs the given message to the Unity console and player log if verbose logging is enabled. Note that verbose logs do not include the callstack
Declaration
public static void LogVerboseFormat(string message, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
String | message | |
Object[] | args |
LogWarning(String)
Logs a warning message.
Declaration
public static void LogWarning(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message | The message to log. |