Logging
console.log()
(and friends) are automatically captured on both the server and the client and streamed into the in-game Log panel—no setup required.
Example
if (this.game.isServer()) {
console.log("hello from server!");
}
if (this.game.isClient()) {
console.log("hello from client!");
}
Produces:
On the server, all logging is captured from STDOUT and STDERR and forwarded to the client. On the client, only console.log is captured. If you want to print to your standard browser console instead, you can use console.info or any other console methods to bypass the log capturing and get regular debug output.