# Can i use a seperated gamelogic instance in match handle?

**URL:** https://forum.heroiclabs.com/t/can-i-use-a-seperated-gamelogic-instance-in-match-handle/5324
**Category:** Runtime Framework
**Tags:** typescript, server-framework
**Created:** [June 8, 2024, 12:44pm UTC](https://forum.heroiclabs.com/t/can-i-use-a-seperated-gamelogic-instance-in-match-handle/5324 "2024-06-08T12:44:07Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![minzojian](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/minzojian/32/2195_2.png) [@minzojian](https://forum.heroiclabs.com/u/minzojian)
#### Post date: [June 13, 2024, 3:07pm UTC](https://forum.heroiclabs.com/t/can-i-use-a-seperated-gamelogic-instance-in-match-handle/5324/7 "2024-06-13T15:07:17Z")

</div>

yes.it works fine. i asked here and got response from heroiclabs guy

> [@How to print debug message in a seprate class other than in match handler hooks](https://forum.heroiclabs.com/t/how-to-print-debug-message-in-a-seprate-class-other-than-in-match-handler-hooks/5345):
>
> 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?

---

_[View the full topic](https://forum.heroiclabs.com/t/can-i-use-a-seperated-gamelogic-instance-in-match-handle/5324)._
