SAV Debug Console
by CraigLubitz
SAVDebugConsole-GODOT
Runtime ("in app") Debug Console for GODOT
Works with both GODOT logs and Android Logcat output
SAV Debug Console is a flexible and light weight GDScript that creates a runtime debug console display that you can add to almost any GODOT application
Display at runtime ("in app") the log output from the print, print_debug and print_stack methods or logcat
SAV Debug Console is a work in progress
GODOT Build 4.2
Features:
- GDScript supports all GODOT platforms
- Supports XR (AR/VR)
- Logcat support for Android (Mobile, Quest, etc. * see know issues)
- Clear logcat button
- Logcat color support
- Scrollable window
- Static logging methods included
- logcat or print
- Entries are date and time stamped with milliseconds
- Light weight and fast
- Easy to use and modify
Required for XR:
godot-xr-tools
- check https://github.com/GodotVR/godot-xr-tools for updates
Quick Start:
Other than XR:
- Instantiate Child Scene
- Search for and Open the SAVDebugConsole scene (addons\SAVDebugConsole\scenes\SAVDebugConsole.tscn)
XR:
- Add a Viewport2Din3D2 (godot-xr-tools)
- Locate the SAVDebugConsole scene (addons\SAVDebugConsole\scenes\SAVDebugConsole.tscn)
- Drag the SAVDebugConsole scene in to Viewport2Din3D2's Content/scene
Examples scenes:
Other than XR:
addons\SAVDebugConsole\examples\scenes\SAVDebugConsoleExample.tscn
- if your getting an XR error, Disable OpenXR in the Project Settings
XR:
addons\SAVDebugConsole\examples\scenes\QuestExample.tscn
- Enable OpenXR in the Project Settings
- Enable godot-xr-tools
- check https://github.com/GodotVR/godot-xr-tools for updates
Settings:
Other than XR:
- Located in the inspector for the SAVDebugConsole element
XR:
- In the Viewport2Din3D2's Content/scene, Click the "Open Scene"
- Adjust in the inspector for the SAVDebugConsole element
Both:
Console Entries Max : int = 100
- max number of entries in the list
- console_entries_max above 100 can cause performance issues
- must be an integer > 0
Logcat : bool = false
- Display GODOT logs and logcat output
- True = logcat logs
Logcat variables : String = ""
** the "-v" can no longer be overridden, it is used internally to control color and polling
- Additional variables to pass to logcat
- Default value shows colored entries
- Currently we use a slightly different format than regular command line options
- Our parser requires a comma and space (", ") to separate command line options from their parameters.
- Usage as indicated in the logcat manual with a comma and space separating the command line option from its parameters
- -s, <tag1>,<tag2>
- Silence all tags but the 2 tags indicated
- Example:
- -s, SAVDebugConsole godot
- comma between the tags in this case is optional
- -s, VrApi,PerformanceManager_ZSF
- -s, SAVDebugConsole godot
- <tag1>:D <tag2>:E *:S
- Silence all tags but Debug messages from tag1 and Error messages from tag2
- Example:
- \SAVDebugConsole:D godot:E *:S
- Replace <tag> with the tag string
- Character formatting for spaces or no spaces after commas matter
- Due to how our parsing works a space after commas is required for command line parameters
- Not all command line options are tested or supported
- -s, <tag1>,<tag2>
Polling : bool = false
- Use polling to gather logcat entries
- True = Use polling
- Some Android phones use buffering.
- This can appear a no logging or logging partial entries.
- Set Polling equal True
Runtime Filter
- Click on the magnifying glass to open the "Filter Properties" entry
- Type in the filter term
- Matches display rows
Print and Log replacements:
_SAVDebugConsole
static func Print(message: String, level: LogLevel = LogLevel.INFO, stack: String = "") -> void:
static func Log(tag : String, message : String, level : LogLevel = LogLevel.INFO) -> void:
-
Eamples:
- _SAVDebugConsole.Print("This is a debug print log entry", LogLevel.DEBUG)
- _SAVDebugConsole.Log("SAVDebugConsole", "This is a warning logcat log entry", LogLevel.WARN)
-
The following characters must be escaped
- ` (single quote)
- Example:
- "A single quote \' is encoded like this"
- A single quote ' is encoded like this
- "A single quote \' is encoded like this"
- Example:
- \ (back slash)
- Example:
- "A single back slash \\\\ is encoded like this"
- A single back slash \ is encoded like this
- "A single back slash \\\\ is encoded like this"
- Example:
- ` (single quote)
Additonal help:
If the quest version runs in a window,
- Check that "QuestExample" is "Set as Main Scene"
- Check project setting XR is enabled
- Check that it has a runnable Android Quest Export
Known issues:
Unknown behavior if GODOT log rotates
Download
Support
If you need help or have questions about this plugin, please contact the author.
Contact Author