Documentation

Logger

The JavaScript API comes equipped with a logging console that is shared by the system and the developer.

On start up of each world, the library creates a singleton AR.logger instance, which can be used by the developer to log messages.

To see the log messages, you need to call the JavaScript function AR.logger.activateDebugMode(). For example in the body.onLoad trigger:

<html>
<body onLoad="javascript:AR.logger.activateDebugMode();">
    <!-- your body content -->
</body>
</html>

When activateDebugMode() is called, it automatically creates a button at the bottom of your display, which allows you to open the Logging console. When you click the button, the logging window appears. Within this window, you can select the log-levels you would like to see, as well as close the logging console again.

Bear in mind that the system itself will also use the logging framework to log messages, thus allowing you to debug if anything unexpected happens.

Please remember to deactivate the logging framework before you actually publish your world by removing the call to activateDebugMode(). Otherwise, the users of your augmented reality experience will always see the button at the bottom of the page, and would be able to follow debug messages.