0
0
Fork 0

Update logs to use Game's logger when possible instead of Global.

This commit is contained in:
Oliver-Akins 2021-01-02 13:32:05 -07:00
parent 93de617d83
commit 5345c97f33
10 changed files with 44 additions and 39 deletions

View file

@ -6,7 +6,7 @@ export default (io: Server, socket: Socket, data: ObjectList) => {
// Assert game exists
if (!games[data.game_code]) {
log.debug(`Can't delete game that doesn't exist: ${data.game_code}`);
log.debug(`Can't get objects for game that doesn't exist: ${data.game_code}`);
socket.emit(`Error`, {
status: 404,
message: `Game with code ${data.game_code} could not be found`,
@ -16,7 +16,7 @@ export default (io: Server, socket: Socket, data: ObjectList) => {
};
let game = games[data.game_code];
log.silly(`[${game.id}] Sent client object card.`);
game.log.silly(`Sent client object card`);
socket.emit(`ObjectList`, {
objects: game.objects
});