0
0
Fork 0

Add a child logger to the Game

This commit is contained in:
Oliver-Akins 2021-01-02 13:29:26 -07:00
parent 8bede05e07
commit 21c9034ab6
2 changed files with 7 additions and 1 deletions

View file

@ -11,7 +11,11 @@ export default (io: Server, socket: Socket, data: CreateGame) => {
let game = new Game(conf, host);
games[game.id] = game;
game.players.push(host);
log.info(`New game created with ID ${game.id} (host=${host.name})`);
game.log = log.getChildLogger({
displayLoggerName: true,
name: game.id,
})
game.log.info(`New game created (host=${host.name})`);
socket.join(game.id);
socket.emit(`GameCreated`, {