I saw Fundebug online mini-game monitoring on SegmentFault. I just started playing WeChat mini-games recently, so I tried to access it.
Access method
When creating a project, select the WeChat mini-game icon in the lower left corner.
Click Continue to enter the plug-in page.
The access process of third-party plug-ins in mini games is similar to that of mini programs. You need to download the plug-in code locally and put it in your own project. And you need to configure the receiving domain name of Fundebug to the legitimate domain name of the request.
Wechat can be said to be very strict in terms of supervision/security. You need to be very aware of the network interactions of the plug-ins you use. If there are illegal plug-ins that secretly send data to other places, they will be blocked in WeChat.
Access to jerking games
After creating a WeChat mini-game in the no-AppID mode, you can see the official demo, including the entry files and configuration files: game.js and game.json. game.js introduces and initializes main.js that contains the entire game scene of the plane, the participants (player plane and enemy plane), and the main function of the game logic.
Create a new libs
folder named to store the third-party library files. Right-click the hard disk to open, and then put the fundebug plugin you just downloaded into it.
Then introduce it in the game.js file, remember to change the copied code release
to libs
.
error test
According to the documentation of WeChat Mini Games, execute the following commands on the console of WeChat Developer Tools:
fundebug.test("Test", "Hello, Fundebug")
The console of Fundebug can see this error message:
I think the best thing is that there are still screenshots of the error! That is to say, you can see what the user interface looks like when an error occurs, whether it is a white screen or a chaotic display, etc., all of which can be seen at a glance.
This function is absolutely necessary to call.
However, I found a problem, that is, the system information and user information are not available when the error occurs. If I really want to contact this user, I don't know who to turn to!
Later, I looked at the documentation. These are not crawled by default and need to be manually configured. For details, please refer to the configuration document: attribute configuration
I added some monitoring properties:
And deliberately changed the code to the wrong (red line position):
Fundebug will have a small red dot prompt:
Click to view the error information of the information, including the device information is displayed.
Moreover, metaData also has the meta information I configured.
Configure the legitimate domain name of the request
Be sure to configure the request legal domain name . It's easy to forget about this. Because in developer mode, errors can already be reported to Fundebug, so it is easy to forget to configure. I just made this mistake, and I have never received an error!
Original link: https://segmentfault.com/a/1190000014753583