Skip to content

SusConsoleService

SusConsoleService

Dev console overlay — intercepts Unity logs, shows them color-coded above all UI, and runs commands with tab-completion and filtering.

Package

SusCore · Devtools (free)

SusConsoleService is a plain C# overlay service, not a .sharq component — there is nothing to drop into a template. Attach it once and it listens to Unity's log pipe for the lifetime of the app.

Usage

csharp
#if DEVELOPMENT_BUILD || UNITY_EDITOR
var console = new SusConsoleService
{
    OverlayHost = SusBootstrap.GetOrCreateOverlay(uiDocument.rootVisualElement),
    ToggleKey = KeyCode.BackQuote, // ~
    MaxEntries = 500,
};
console.Attach(); // subscribes to Application.logMessageReceivedThreaded, spawns the hotkey driver
#endif

Press ~ (or call Toggle()) to open the console from the bottom of the screen. Logs are colored by severity (gray/yellow/red for Log/Warning/Error), auto-scroll to the newest entry unless you have scrolled up manually, and can be narrowed by the All / Log / Warn / Err filter chips or the search field. The command field runs registered commands on Enter and completes the current prefix on Tab; clear, help, and filter <all|log|warn|error> are built in — register more with RegisterCommand.

MemberRole
OverlayHostOverlay layer the console mounts into (Console category — topmost)
ToggleKeyHotkey that opens/closes the console (default ~)
MaxEntriesRing-buffer size for captured log lines
IsOpenWhether the console is currently shown
Attach() / Detach()Start/stop log interception and the hotkey driver
Show() / Hide() / Toggle()Open/close the overlay
SetFilter(ConsoleFilter) / SetSearch(string)Narrow the visible log lines
RegisterCommand(name, handler, help)Add a command to the input field
ExecuteCommand(input)Run a command programmatically

Notes

  • Free — ships with sus-core, no SusKit purchase needed.
  • Wrap construction in #if DEVELOPMENT_BUILD || UNITY_EDITOR to keep it out of release builds.
  • Full setup walkthrough and command-registration recipes: see the Dev Console guide in the package docs.