How to debug the game running on the phone by remote logs

Has invited:

249561037

Favor from: elmigo

Engine provide the function that sends the trace to romote log server.It can send the trace in the code to designated server so that trace display remotely and it's used to trace and debug the game running state. We can turn on it like this:
1. Add field remoteLogUrl to config of StartGame.html, configuring URL on the server, such as http://115.159.121.224:8900.
2. using log interface provided by instance game.log to output logs.
 
Remote logs server receive trace and implementating display:
1. Background of editor built-in editorService already provide support, which can configure above remoteLogUrl as http://localhost:5002,and changing localhost to your own ip address.
2. Simple server provided by official(http://docs.zuoyouxi.com/manual/Plugin/server.html) also provides support
3.Only do you need to receive POST /remoteLog message string if implementating php server by yourself.It will do after entering the string you received into the display.

Morabaraba - A ancient African game

Favor from:

Hi
 
I also wanted to use the POST /remoteLog functionality. But found the QICIEngine-Server example to much for my needs.
 
So I hacked this simple express app together: https://gist.github.com/Morabaraba/fddd168798de959fba5cb97d69e90e0d
 
You should be able to implement it in PHP, just remember to set the 'Access-Control-Allow-Origin' and other headers(see my script to see which I set).

To reply to a question, please Login or registered