Realtime Debug Console

The debug console allows you to view and edit the contents of the Realtime model on an active document. To launch the console run this command in the javascript console:

gapi.drive.realtime.debug();

The console opens in a panel at the bottom of the page. It provides a tree of all of the open Realtime documents on the page, including the collaborators on each document and an interactive view of the model.

screenshot of debugger panel

Edit

Edit mode allows you to add, remove, edit or reorder values within the data model. To enter edit mode, select the Edit checkbox in the upper right.

screenshot of debugger edit mode

View Events

Events mode displays a list of events as they occur. This display includes both local and remote events. To enable events, select the View Events checkbox in the upper right.

screenshot of debugger events mode

Debug

In debug mode you can add breakpoints on collaborative objects. When the collaborative object changes, the browser's debugger will pause at the location in the code where the change was made. Note that the immediate pause location will be within the Realtime API code. However, you should be able to locate the location in your code by looking at the callstack.

screenshot of debugger debug mode

See it on Github

The debug console is open source on Github. Check out the code that powers it, or provide your own improvements.

Enviar comentarios sobre…