Implement logger on back

This commit is contained in:
Alexis Faizeau 2021-11-08 17:44:44 +01:00
parent c573e9fbaf
commit 6a195be814
17 changed files with 260 additions and 76 deletions

View file

@ -10,6 +10,7 @@ import {
import { User } from "_Model/User";
import { variablesRepository } from "./Repository/VariablesRepository";
import { redisClient } from "./RedisClient";
import log from "./Logger";
interface Variable {
defaultValue?: string;
@ -98,7 +99,7 @@ export class VariablesManager {
for (const object of layer.objects) {
if (object.type === "variable") {
if (object.template) {
console.warn(
log.warn(
'Warning, a variable object is using a Tiled "template". WorkAdventure does not support objects generated from Tiled templates.'
);
continue;
@ -204,7 +205,7 @@ export class VariablesManager {
if (variableObject !== undefined && variableObject.persist) {
variablesRepository
.saveVariable(this.roomUrl, name, value)
.catch((e) => console.error("Error while saving variable in Redis:", e));
.catch((e) => log.error("Error while saving variable in Redis:", e));
}
return readableBy;