Debugging Code

Christian Zirkelbach edited this page Nov 28, 2018 · 5 revisions

This page presents how one can enable and use debugging modes for the frontend and backend.

Backend

Eclipse Debugging

Select the related Run Configuration from explorViz-backend/run-configurations, e.g., ExplorViz-Landscape.launch, and run it via Debug.

Frontend

JS Code Logging

Use debug statements, e.g., this.debug("my log message", myToBeLoggedObject); to log any information from your code. You must enable the logging in Google Chrome by passing the logging targets to the debugger. Open the Chrome Dev Tools (Ctrl + Shift + J in Windows) and insert one of the following commands into the console:

  1. debug.enable('route:visualization'); : Google Chrome will only log messages from the visualization route.
  2. debug.enable('route:*, component:landscape-rendering'); : Google Chrome will log messages from any route and the landscape-rendering component.
  3. debug.enable('*'); : Google Chrome will log executed log statement

JS Code Debugging

  1. Open your Google Chrome Dev Tools (Ctrl + Shift + J in Windows)
  2. Add the debugger; statement to any reachable code segment
  3. If the execution reaches the debugger; statement, it will pause and highlight the break point in your dev tools. Furthermore you are able to see variables inside of this scope in the Scope section.

The screenshot below shows an exemplary execution:

dev-tools-debugging

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.