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

@ -2,10 +2,11 @@ import { RedisVariablesRepository } from "./RedisVariablesRepository";
import { redisClient } from "../RedisClient";
import { VoidVariablesRepository } from "./VoidVariablesRepository";
import { VariablesRepositoryInterface } from "./VariablesRepositoryInterface";
import log from "../../Services/Logger";
let variablesRepository: VariablesRepositoryInterface;
if (!redisClient) {
console.warn("WARNING: Redis isnot configured. No variables will be persisted.");
log.warn("WARNING: Redis isnot configured. No variables will be persisted.");
variablesRepository = new VoidVariablesRepository();
} else {
variablesRepository = new RedisVariablesRepository(redisClient);