How to print debug message in a seprate class other than in match handler hooks

i created a GameLogic class to manager the game flow, instead of write all game code directly in loop hooks.

i will re-new it in each begining of loop, and serialize and store it in the end of loop.

now i want print out some debug information inside of it.

console.log is not work.
and i try to transfer the logger object from the paramter of loop handler to the GameLogic when create it. like new GameLogic(logger). however, it is not work.

has any one got clue to solve it?

Hello @minzojian

console.log is exposed by the browser so it is not available in Nakama. You cannot keep a reference to the logger in the match state because it cannot be serialized, you should just receive it as a param function and wire it through from the match handler functions.

Hope this helps.

thanks for your reply.
i send logger.debug as the constractor parameter in GameLogic.
then use it to print out information inside. it works!