Class SimpleConsole
A simple runtime console to help in debugging on device.
Namespace: Microsoft.MixedReality.WorldLocking.Tools
Assembly: cs.temp.dll.dll
Syntax
public class SimpleConsole : MonoBehaviour
Remarks
The system accepts a verbosity level along with each line of text. If the system is enabled, If the verbosity level is >= the logVerbosity the line is written to the Unity log file via Debug.Log(). If the verbosity level is >= the screenVerbosity the line will be displayed on screen. If the system is NOT enabled If the verbosity level is >= 5 the line is written to the Unity log file. To enable the system:
- Add a SimpleConsole component to any game object in the scene.
- Fill in the SimpleConsole's TextMesh console field with a valid TextMesh. Ideally, place the console TextMesh where it can be seen. If enabled, then every frame the last lineCount lines added are displayed on the console TextMesh, where lineCount is an inspector accessible property below. Use is thread safe, and from threads besides the main thread.
Fields
console
Declaration
public TextMesh console
Field Value
Type | Description |
---|---|
TextMesh |
logVerbosity
Declaration
public int logVerbosity
Field Value
Type | Description |
---|---|
Int32 |
screenVerbosity
Declaration
public int screenVerbosity
Field Value
Type | Description |
---|---|
Int32 |
Properties
Active
Whether the onscreen component is active.
Declaration
public static bool Active { get; }
Property Value
Type | Description |
---|---|
Boolean |
LineCount
The maximum number of lines to display.
Declaration
public int LineCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
LogFile
Declaration
public string LogFile { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
AddLine(Int32, String)
Static helper for adding a line of text for output.
Declaration
public static int AddLine(int level, string line)
Parameters
Type | Name | Description |
---|---|---|
Int32 | level | The verbosity level of this line. |
String | line | The text to display and/or write. |
Returns
Type | Description |
---|---|
Int32 | The number of lines added. |