Page 1 of 1

How to debug a game in Alpha?

Posted: 22 November 2020, 03:43
by GoDodyGo
PHP: How can I see the server-side PHP log?
JS: Is it OK to add console.log back to the code so I can see what's going on?

If I cannot get these things, how to do debugging? The Alpha release works a little differently in Studio release (for some functions).

Re: How to debug a game in Alpha?

Posted: 22 November 2020, 10:08
by Tisaac
GoDodyGo wrote: 22 November 2020, 03:43 The Alpha release works a little differently in Studio release (for some functions).
For which functions ? That's not supposed to be the case in general, the only difference being the js file is minified, which you can test on the studio in the control panel.

Re: How to debug a game in Alpha?

Posted: 22 November 2020, 21:13
by GoDodyGo
Specifically there seems to be some issue with Safari browser. At one specific game operation, the PHP side checks for valid combinations of cards being submitted by the player. One failure I saw shows the PHP side rejecting the submission from the Safari player as invalid (it sends a message via notify), however the cards which were chosen are not invalid. The player reports the computer becomes briefly unresponsive, as if the script is pegging the CPU.

Other browsers have never shown this issue, in hundreds/thousands of this specific operation. Safari has not been tested as heavily as others. I need some time to get a better device to test more.

Summary: During a specific operation, the PHP side produced some message to the player which should never had occurred. The player's action was OK but PHP saw it as invalid.

So, I want to see my PHP logs to see what the PHP code is seeing and why it produced that message to that Player.

And I want to see console.log from the Safari browser, but I've had to remove it all, but I will now try to put it back in.

On Studio we had 1 Safari tester and didn't see this particular issue yet even going through this operation (but not tested many many times yet - I will do more).

Re: How to debug a game in Alpha?

Posted: 22 November 2020, 23:15
by Tisaac
Why not using browserstack on studio to test Safari then ?

Re: How to debug a game in Alpha?

Posted: 29 November 2020, 10:39
by Een
On the JS side, you can use console.error if you want to display some specific traces in the console in prod. Only console.log are removed.

On the PHP side, you should use self::warn or self::error if you want to see the matching logs in production.

Re: How to debug a game in Alpha?

Posted: 14 December 2020, 04:04
by GoDodyGo
Thanks for the reference to browserstack. I didn't know about them and will take a look.

When self::warn and self::error are used, where do the messages go? I don't see a way to see a log.

Re: How to debug a game in Alpha?

Posted: 14 December 2020, 12:44
by Een
You have a "see errors in production" block on your manage page (nb: needs to enable popups)

Re: How to debug a game in Alpha?

Posted: 01 January 2021, 07:07
by GoDodyGo
OK I see that "see errors in production" button, thanks.

And Tisaac I was able to get a free 1 year open-source account from browserstack! So I should be able to debug the Safari issues directly. It took me a bit to get the proper license file put in so they'd grant me it, but got it done.

Thanks for the guidance?