DXStudio has implemented Javascript as its control language. Of course there are a few departures from the pure ECMA Javascript implementation. Many are to directly control the 2D and 3D assets in your project. A few were added to aid in development.
The “print()” command is extremely useful. If you have properly enabled it in your Document Properties (see image), the ‘console’ can display useful debug information.

DX Document Properties
In the scripting code you can reveal the value of variables (and objects) by sending output to the console with the “print()” command. The trouble comes when you wish to release your work to the public. Even if you are testing or sharing with a small group of fellow developers, numerous print commands can produce a very annoying result by displaying lots of superfluous information. The console obscures part of the display, often times when you are trying to SEE something important.
Removing, or adding remarks to disable, the many “print()” commands is tedious and troublesome. Remembering
where they all exist can be a tremendous task in itself on a large project that includes many scenes and/or objects with script in them.
By substituting the internal “print()” command in DXStudio with a simple function, you can toggle the debug display by modifying ONE value in ONE place in your code! Here’s how to do it.
In the Document script add the lines shown. The DEBUG constant is the key to this. Changing it will affect
all instances of a console print command at once.

Document Script commands
Then anywhere in your scripts that you wish to output DEBUG information to the console display.

Example of DEBUG output - in place of a simple 'print()' command
But, whenever you wish to suppress the DEBUG output, simply change the value of the constant “DEBUG” to false!
There are many enhancements that could be made to this simple idea. Even an independent class could be created that adds some other useful “debug” operations. I will leave those enhancements up to the creative and adventuresome reader. But PLEASE send me your favorite changes and they will appear here in an update to this post.