Skip to content

Console To Ui

eisclimber edited this page Feb 11, 2024 · 1 revision

Console To Ui

class in ExPresSXR.UI / Extends MonoBehavior
GameObject instantiable via ComponentMenu

Description

This component that can be added to a TMP_Text to display the console log inside the application. The first element of the Stack Trace will be logged too.

Please note that you can connect your device to your your computer and select it as "Connected Player" in the editor. Use this component instead if this is not possible.
A discussion and credits to bboysil on this topic: https://answers.unity.com/questions/125049/is-there-any-way-to-view-the-console-in-a-build.html

Members

Editor Properties

  • int _maxLines: Number of max lines after which the oldest lines get removed. No restriction if less or equal to 0. Default: -1
  • LogTypFilter _logTypeFilter: Which types of logs should be displayed. Default: Everything
  • TMP_Text _textDisplay: Reference to the TMP_Text that should display the console log.

Public Methods

  • void AppendToLog(string logString, string stackTrace, LogType type): Adds an entry to the logs displayed. Will be automatically be called when something is logged to the console.
  • void AppendTestEntryShort(): Helper functions to log a short string via the Components context menu
  • void AppendTestEntryLong(): Helper functions to log a long string via the Components context menu

Enums

  • LogTypeFilter: Reflects UnityEngine.LogType but as flags. Used to filter certain LogTypes. Available options are: Error, Assert, Warning, Log, Exception

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally