A class in Root.Township, the global namespace.
Shows the latest server console log lines in a UI Text, coloured by log level.
Constructors
| Member | What it is |
|---|
ConsoleDisplay() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private List<ConsoleDisplay.Log> logs | Log lines kept for display. |
private static readonly Dictionary<LogLevel, string> logTypeColors | Hex colour per log level: red for errors, yellow for warnings, black otherwise. |
private int rows | Most lines shown. |
private Text text | The UI text that shows the log. |
Methods
3 private and internal methods
| Member | What it is |
|---|
private void HandleLog(string message, LogLevel logLevel) | Adds a log line, drops the oldest past rows, and rebuilds the text. |
private void OnDisable() | Stops listening to the server console log. |
private void OnEnable() | Gets the Text and starts listening to ServerConsoleLogTarget.LogSent. |