Skip to content

Add in-engine log overlay debug tool#2001

Open
Dogebusters wants to merge 4 commits into
decentraland:mainfrom
Dogebusters:feat/engine-log-overlay
Open

Add in-engine log overlay debug tool#2001
Dogebusters wants to merge 4 commits into
decentraland:mainfrom
Dogebusters:feat/engine-log-overlay

Conversation

@Dogebusters

Copy link
Copy Markdown
Contributor

Summary

Adds an in-engine log overlay that can be enabled from Developer settings.

This is mainly useful for mobile debugging, where checking engine/runtime logs usually requires adb/logcat. The overlay makes it easier to inspect logs directly in the running app and can later be extended for additional debug output.

Changes

  • Added an EngineLogTap logger that captures engine log messages, warnings, script errors, shader errors, and dropped log count.
  • Added an EngineLogService that installs/uninstalls the logger and opens the overlay UI.
  • Added an EngineLogOverlay UI for viewing logs in-engine.
  • Added a Developer settings toggle for enabling/disabling the engine log overlay.
  • Mobile touch handling for dragging and resizing the overlay.

Screenshots

Screenshots taken on Android, Nothing Phone (1).

Engine log overlay closed in Developer settings Engine log overlay enabled on Android

Commit overview

  • Add engine log overlay debug tool
    Adds the engine log capture service, log tap, and overlay UI.

  • Add Developer settings toggle for engine logs
    Adds the Engine Logs toggle to the Developer settings UI.

  • Wire Engine Logs toggle to service
    Connects the Developer settings toggle with the engine log overlay service.

  • Fix engine log overlay touch handling
    Improves mobile touch handling for overlay buttons, dragging, and resize zones.

Testing

Tested on Android using a Nothing Phone (1)

  • Enabled and disabled the Engine Logs toggle from Developer settings.
  • Opened the overlay in-game.
  • Verified log output appears in the overlay.
  • Tested clear, pause/play, tail toggle, dragging, and resizing on touch input.

## File overview

### `engine_log_tap.gd`

Captures Godot engine log output.

This class extends `Logger` and receives log messages from Godot through `OS.add_logger()`. It stores the latest log lines in memory, keeps the list capped to avoid unbounded growth, and tracks how many old lines were dropped.

It handles:

- regular log messages
- errors
- warnings
- script errors
- shader errors
- optional backtraces

### `engine_log_service.gd`

Manages the lifecycle of the engine log tool.

This service installs and uninstalls the `EngineLogTap`, owns the current logger instance and creates or removes the overlay UI. It acts as the bridge between Settings and the overlay.

It handles:

- enabling/disabling the engine log capture
- adding/removing the logger from `OS`
- creating the overlay
- forwarding log lines, clear requests, and dropped-line count to the UI

### `engine_log_overlay.gd`

Displays the captured logs inside the app.

This is the visible debug window. It builds the UI in code, renders the captured log lines, and provides basic controls like pause, clear, and tail-follow. The window can be dragged and resized.

On mobile, it also prevents accidental Explorer camera/player movement while interacting with the overlay or near its edges.

Signed-off-by: MeanGreenDoge <118309896+Dogebusters@users.noreply.github.com>
…verlay.

The scene change only adds the UI entry/checkbox (`CheckButton_EngineLogsEnabled`) and connects it to the settings.gd script. The actual logger installation, overlay creation, and log rendering logic live in the new engine log scripts.

Signed-off-by: MeanGreenDoge <118309896+Dogebusters@users.noreply.github.com>
- Creates or finds the engine log service when enabled.
- Installs or removes the engine log capture depending on the toggle state.
- Keeps the toggle state in sync with the current engine log service state.

Signed-off-by: MeanGreenDoge <118309896+Dogebusters@users.noreply.github.com>
Improves mobile interaction with the overlay by making header buttons easier to tap and expanding resize hit areas around the panel. Resize zones are kept above the input blocker so edge/corner resizing still works outside the panel bounds.

Signed-off-by: MeanGreenDoge <118309896+Dogebusters@users.noreply.github.com>

@kuruk-mm kuruk-mm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thank you for the Contribution!

We can enable this, but only using the same DEBUG CONSOLE that we have in the PREVIEW.

Check also how it works. We don't instantiate objects if we are not going to use them. Check how the preview works, and try to implement as a new tab there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants